forked from krlmlr/debian-ssh
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (19 loc) · 770 Bytes
/
Dockerfile
File metadata and controls
22 lines (19 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM debian:buster
# Install packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssh-server sudo python
ADD set_root_pw.sh /set_root_pw.sh
ADD run.sh /run.sh
RUN chmod +x /*.sh
RUN mkdir -p /var/run/sshd
## Set a default user. Available via runtime flag `--user docker`
## Add user to 'staff' group, granting them write privileges to /usr/local/lib/R/site.library
## User should also have & own a home directory, but also be able to sudo
RUN useradd docker \
&& passwd -d docker \
&& mkdir /home/docker \
&& chown docker:docker /home/docker \
&& addgroup docker staff \
&& addgroup docker sudo \
&& echo "docker ALL=(ALL) NOPASSWD: ALL" | sudo EDITOR="tee -a" visudo
EXPOSE 22
CMD ["/run.sh"]