coder-enterprise-images/images/base/Dockerfile.ubuntu

61 lines
1.6 KiB
Docker

FROM ubuntu:21.04
SHELL ["/bin/bash", "-c"]
# Install baseline packages
RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" apt-get install --yes \
apt-transport-https \
bash \
build-essential \
ca-certificates \
curl \
gnupg \
htop \
locales \
lsb-release \
man \
python3 \
python3-pip \
software-properties-common \
sudo \
systemd \
systemd-sysv \
unzip \
vim \
wget && \
# Install latest Git using their official PPA
add-apt-repository ppa:git-core/ppa && \
DEBIAN_FRONTEND="noninteractive" apt-get install --yes git
# Copy configuration files to appropriate locations
COPY etc/apt/sources.list.d/* /etc/apt/sources.list.d/
COPY usr/share/keyrings/* /usr/share/keyrings/
# Docker (from official repository)
RUN apt-get update --quiet && \
apt-get install --no-install-recommends --yes --quiet \
containerd.io \
docker-ce \
docker-ce-cli && \
# Delete package cache to avoid consuming space in layer
apt-get clean
# Enables Docker starting with systemd
RUN systemctl enable docker
# Add a user `coder` so that you're not developing as the `root` user
RUN useradd coder \
--create-home \
--shell=/bin/bash \
--groups=docker \
--uid=1000 \
--user-group && \
echo "coder ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers.d/nopasswd
USER coder
# install Homebrew, must be as a non-root user
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
ENV PATH /home/linuxbrew/.linuxbrew/bin:${PATH}