feat: add docker and dockerd systemd service to base images (#37)

This commit is contained in:
Charles Moog 2020-12-16 12:20:27 -06:00 committed by GitHub
parent 25eaa0bfd1
commit ed0a191a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 0 deletions

View File

@ -6,6 +6,7 @@ SHELL ["/bin/bash", "-c"]
RUN pacman --noconfirm -Syu \
base \
base-devel \
docker \
git \
bash \
curl \
@ -19,6 +20,9 @@ RUN pacman --noconfirm -Syu \
openssh \
ca-certificates
# Enables Docker starting with systemd
RUN systemctl enable docker
# Add coder user.
RUN useradd -mUs /bin/bash coder && \
echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd

View File

@ -4,8 +4,12 @@ FROM centos:8
RUN yum -y install epel-release
RUN yum repolist
RUN yum update -y && yum install -y yum-utils device-mapper-persistent-data lvm2
RUN yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# Install baseline packages
RUN yum update -y && yum install -y \
docker-ce \
gcc \
gcc-c++ \
make \
@ -21,6 +25,9 @@ RUN yum update -y && yum install -y \
python3 \
ca-certificates
# Enables Docker starting with systemd
RUN systemctl enable docker
# Add a user `coder` so that you're not developing as the `root` user
RUN adduser coder && \
echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd

View File

@ -5,6 +5,7 @@ RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \
build-essential \
git \
bash \
docker.io \
curl \
wget \
unzip \
@ -12,11 +13,18 @@ RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \
man \
vim \
sudo \
systemd \
python3 \
python3-pip \
ca-certificates \
locales
# Enables Docker starting with systemd
RUN systemctl enable docker
# use systemd as the init
RUN ln -s /lib/systemd/systemd /sbin/init
# Add a user `coder` so that you're not developing as the `root` user
RUN adduser --gecos '' --disabled-password coder && \
echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd