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

65 lines
1.7 KiB
Docker

FROM quay.io/centos/centos:stream8
SHELL ["/bin/bash", "-c"]
# Add the EPEL repolist
RUN dnf upgrade --assumeyes --refresh && \
dnf install --assumeyes epel-release && \
dnf install --assumeyes \
bash \
ca-certificates \
curl \
device-mapper-persistent-data \
dnf-utils \
gcc \
gcc-c++ \
git \
htop \
lvm2 \
make \
man \
python3 \
sudo \
unzip \
vim \
wget \
rsync && \
dnf clean all
RUN dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
dnf install --assumeyes \
containerd.io \
docker-ce && \
systemctl enable docker
# Add docker-compose
RUN curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
RUN chmod +x /usr/local/bin/docker-compose
# Make typing unicode characters in the terminal work.
ENV LANG en_US.UTF-8
# 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 HOMEBREW_INSTALL_FROM_API=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
USER ROOT
# install our deprecation message wrapper for homebrew
COPY homebrew-wrapper.sh /usr/local/bin/brew
# remove the bundled ruby from homebrew to save space, homebrew reinstalls
# anyways
RUN rm -rf /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby
USER CODER