|
17 | 17 | FROM nestybox/ubuntu-bionic-systemd:latest
|
18 | 18 |
|
19 | 19 | # 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 |
28 | 54 |
|
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 |
34 | 60 |
|
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 |
46 | 61 | EXPOSE 22
|
47 | 62 |
|
48 | 63 | # Set systemd as entrypoint.
|
|
0 commit comments