Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 8ee5649

Browse files
ctalledorodnymolina
authored andcommitted
Minor fix in dockerfiles for ubuntu-*-systemd-docker images.
1 parent c69d461 commit 8ee5649

File tree

3 files changed

+43
-26
lines changed

3 files changed

+43
-26
lines changed

dockerfiles/ubuntu-bionic-systemd-docker/Dockerfile

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,47 @@
1717
FROM nestybox/ubuntu-bionic-systemd:latest
1818

1919
# Docker install
20-
RUN apt-get update && apt-get install --no-install-recommends -y \
21-
apt-transport-https \
22-
ca-certificates \
23-
curl \
24-
gnupg-agent \
25-
software-properties-common
26-
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
27-
RUN apt-key fingerprint 0EBFCD88
20+
RUN apt-get update && apt-get install --no-install-recommends -y \
21+
apt-transport-https \
22+
ca-certificates \
23+
curl \
24+
gnupg-agent \
25+
software-properties-common && \
26+
\
27+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
28+
| apt-key add - && \
29+
\
30+
apt-key fingerprint 0EBFCD88 && \
31+
\
32+
add-apt-repository \
33+
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
34+
$(lsb_release -cs) \
35+
stable" && \
36+
\
37+
apt-get update && apt-get install --no-install-recommends -y \
38+
docker-ce docker-ce-cli containerd.io && \
39+
\
40+
# Housekeeping
41+
apt-get clean -y && \
42+
rm -rf \
43+
/var/cache/debconf/* \
44+
/var/lib/apt/lists/* \
45+
/var/log/* \
46+
/tmp/* \
47+
/var/tmp/* \
48+
/usr/share/doc/* \
49+
/usr/share/man/* \
50+
/usr/share/local/* && \
51+
\
52+
# Add user "admin" to the Docker group
53+
usermod -a -G docker admin
2854

29-
RUN add-apt-repository \
30-
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
31-
$(lsb_release -cs) \
32-
stable"
33-
RUN apt-get update && apt-get install --no-install-recommends -y docker-ce docker-ce-cli containerd.io
55+
# Sshd install
56+
RUN apt-get update && apt-get install --no-install-recommends -y \
57+
openssh-server && \
58+
mkdir /home/admin/.ssh && \
59+
chown admin:admin /home/admin/.ssh
3460

35-
# Add user "admin" to the Docker group
36-
RUN usermod -a -G docker admin
37-
38-
# sshd install
39-
RUN apt-get update && apt-get install --no-install-recommends -y openssh-server
40-
RUN mkdir /var/run/sshd
41-
RUN echo 'admin:admin' | chpasswd
42-
RUN sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
43-
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
44-
RUN mkdir /root/.ssh
45-
RUN mkdir /home/admin/.ssh
4661
EXPOSE 22
4762

4863
# Set systemd as entrypoint.

dockerfiles/ubuntu-eoan-systemd-docker/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
5454
# Sshd install
5555
RUN apt-get update && apt-get install --no-install-recommends -y \
5656
openssh-server && \
57-
mkdir /home/admin/.ssh
57+
mkdir /home/admin/.ssh && \
58+
chown admin:admin /home/admin/.ssh
5859

5960
EXPOSE 22
6061

dockerfiles/ubuntu-focal-systemd-docker/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
5454
# Sshd install
5555
RUN apt-get update && apt-get install --no-install-recommends -y \
5656
openssh-server && \
57-
mkdir /home/admin/.ssh
57+
mkdir /home/admin/.ssh && \
58+
chown admin:admin /home/admin/.ssh
5859

5960
EXPOSE 22
6061

0 commit comments

Comments
 (0)