FROM ubuntu
RUN apt-get update \
&& apt-get install -y \
curl \
ca-certificates \
git \
golang \
sudo \
vim \
wget \
# Install Python
python3 \
python3-pip \
python3-venv \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Install nodejs and MegaLinter globally
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - \
&& sudo apt-get install -y nodejs \
&& sudo npm install mega-linter-runner -g
# Add Docker's official GPG key:
RUN sudo install -m 0755 -d /etc/apt/keyrings \
&& sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc \
&& sudo chmod a+r /etc/apt/keyrings/docker.asc \
&& echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Docker install
RUN sudo apt-get update \
&& sudo apt-get install -y \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin
# Fix locale
RUN sudo apt-get update \
&& apt-get install -y locales \
&& sudo locale-gen en_US.UTF-8 \
&& sudo update-locale LANG=en_US.UTF-8
ARG USER=coder
RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER}
USER ${USER}
WORKDIR /home/${USER}
# Add user to docker group
RUN sudo usermod -aG docker $USER \
&& newgrp docker