1
1
FROM alpine:latest
2
2
3
- # - build tools are for: fig2dev which is needed by gnupg builds
4
- # - openssh is for scp
5
- # - tini is for PID 1
6
- # - changing alpine from 3.6 to 3.7 is for ansible 2.4,
7
- # but need to install ansible 2.3 for dependencies first
8
- # - shellcheck is not in the apk repository (xz/tar needed for shellcheck)
9
- # - bundler/rspec is not found on kitchen verify (symlink needed)
10
-
11
3
RUN apk add --no-cache --update \
12
- curl net-tools \
13
- openssh-server openssh \
14
- sudo bash tini \
15
- ansible git rsync xz \
16
- gcc autoconf automake g++ libffi-dev tar libxpm-dev make \
17
- autoconf automake imagemagick-dev texinfo gettext-dev libgcrypt-dev \
18
- libgpg-error-dev libassuan-dev libksba-dev npth-dev libxfont-dev \
19
- libwmf-dev libx11-dev libxt-dev libxext-dev libxml2-dev libexif-dev perl \
20
- ruby-dev ruby-bundler \
21
- && ln -s /usr/bin/bundle /usr/local/bin/bundle \
22
- && ln -s /usr/bin/rspec /usr/local/bin/rspec \
23
- && sed -i -e 's/v3\. 6/v3.7/g' /etc/apk/repositories \
24
- && apk add --update-cache --upgrade ansible \
25
- && sed -i -e 's/v3\. 7/v3.6/g' /etc/apk/repositories \
26
- && apk add --update-cache \
27
- && curl --silent -L -o shellcheck.tar.xz https://storage.googleapis.com/shellcheck/shellcheck-latest.linux.x86_64.tar.xz \
28
- && tar -vxf shellcheck.tar.xz \
29
- && mv shellcheck-latest/shellcheck /usr/local/bin/ \
30
- && sudo mkdir -p /usr/local/src/ \
31
- && git clone https://github.com/Distrotech/transfig.git && cd transfig \
32
- && make && make install \
33
- && cp -R /usr/X11R7/bin/fig2dev /usr/local/bin \
4
+ bash \
5
+ build-base \
6
+ coreutils \
7
+ curl \
8
+ findutils \
9
+ gcc \
10
+ libffi-dev \
11
+ musl-dev \
12
+ net-tools \
13
+ openrc \
14
+ openssh \
15
+ openssh-server \
16
+ openssh-sftp-server \
17
+ openssl-dev \
18
+ py-boto \
19
+ py2-pip \
20
+ python2-dev \
21
+ rsyslog \
22
+ sudo \
23
+ xz \
24
+ && pip install --upgrade pip \
34
25
&& if ! getent passwd <%= @username %>; then \
35
- adduser -h /home/<%= @username %> -s /bin/bash <%= @username %>; \
26
+ adduser -h /home/<%= @username %> -s /bin/bash -D <%= @username %>; \
36
27
passwd -d <%= @username %>; \
37
28
fi \
38
29
&& echo "<%= @username %> ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
@@ -44,10 +35,10 @@ RUN apk add --no-cache --update \
44
35
&& chown <%= @username %> /home/<%= @username %>/.ssh/authorized_keys \
45
36
&& chmod 0600 /home/<%= @username %>/.ssh/authorized_keys \
46
37
&& sed -ri 's/^#?PubkeyAuthentication\s +.*/PubkeyAuthentication yes/' /etc/ssh/sshd_config \
38
+ && sed -ri 's/^#?PasswordAuthentication\s +.*/PasswordAuthentication no/' /etc/ssh/sshd_config \
39
+ && sed -ri 's/^#?ChallengeResponseAuthentication\s +.*/ChallengeResponseAuthentication no/' /etc/ssh/sshd_config \
47
40
&& sed -ri 's/^#?UsePrivilegeSeparation\s +.*/UsePrivilegeSeparation no/' /etc/ssh/sshd_config \
48
41
&& echo "UseDNS=no" >> /etc/ssh/sshd_config \
49
- && ssh-keygen -A
42
+ && rc-update add sshd
50
43
51
44
EXPOSE 22
52
-
53
- VOLUME [ "/sys/fs/cgroup" ]
0 commit comments