Benjamin Copeland | 6996e44 | 2021-04-15 16:27:49 +0100 | [diff] [blame] | 1 | FROM node:10-alpine |
| 2 | |
Fathi Boudra | 4382e93 | 2021-04-20 17:01:16 +0200 | [diff] [blame^] | 3 | # Can be overriden at build time |
| 4 | ARG BUILDSLAVE_PASSWORD=buildslave |
| 5 | |
Benjamin Copeland | 6996e44 | 2021-04-15 16:27:49 +0100 | [diff] [blame] | 6 | COPY setup-sshd /usr/sbin/setup-sshd |
| 7 | |
| 8 | RUN set -e ;\ |
Fathi Boudra | 4382e93 | 2021-04-20 17:01:16 +0200 | [diff] [blame^] | 9 | # install deps |
Benjamin Copeland | 6996e44 | 2021-04-15 16:27:49 +0100 | [diff] [blame] | 10 | apk add openssh bash sudo ;\ |
Fathi Boudra | 4382e93 | 2021-04-20 17:01:16 +0200 | [diff] [blame^] | 11 | # Setup buildslave user for Jenkins |
Benjamin Copeland | 6996e44 | 2021-04-15 16:27:49 +0100 | [diff] [blame] | 12 | adduser buildslave -D -s /bin/bash ;\ |
Fathi Boudra | 4382e93 | 2021-04-20 17:01:16 +0200 | [diff] [blame^] | 13 | echo "buildslave:$BUILDSLAVE_PASSWORD" | chpasswd ;\ |
Benjamin Copeland | 6996e44 | 2021-04-15 16:27:49 +0100 | [diff] [blame] | 14 | echo 'buildslave ALL = NOPASSWD: ALL' > /etc/sudoers.d/jenkins ;\ |
Fathi Boudra | 0acd797 | 2021-04-19 15:46:44 +0200 | [diff] [blame] | 15 | chmod 0440 /etc/sudoers.d/jenkins |
Benjamin Copeland | 6996e44 | 2021-04-15 16:27:49 +0100 | [diff] [blame] | 16 | |
Benjamin Copeland | 6996e44 | 2021-04-15 16:27:49 +0100 | [diff] [blame] | 17 | EXPOSE 22 |
| 18 | ENTRYPOINT ["/usr/sbin/setup-sshd"] |