-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
64 lines (51 loc) · 1.38 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM alpine:3.6
MAINTAINER isca
## Install all the Packages
RUN apk add --no-cache \
shadow \
openssh \
weechat \
weechat-aspell \
weechat-lua \
weechat-perl \
weechat-ruby \
tor \
tmux && rm -rf /tmp/* /var/cache/apk/*
## Configure the container
# Fix sshd for priviliege separation
RUN mkdir /var/run/sshd
RUN chmod 700 /var/run
## Configure ssh
ADD sshd_config /etc/ssh/
#
## Create /data
RUN mkdir /data
#
## Configure Weechat
RUN groupadd weechat
RUN useradd -m -d /home/weechat -g weechat -s /home/weechat/login.sh weechat
RUN usermod -p '*' weechat
## Add files not to be changed by the end user
ADD login.sh /home/weechat/
ADD config.txt /home/weechat/
## Add startup script
ADD startup.sh /usr/sbin/
## Add authorized_keys placeholder
RUN (mkdir /home/weechat/.ssh; chown -R weechat.weechat /home/weechat/.ssh; chmod 700 /home/weechat/.ssh)
RUN touch /data/authorized_keys
RUN ln -s /data/authorized_keys /home/weechat/.ssh/
##RUN ln -sf /dev/stdout /var/log/ssh
## Configure Tmux
ADD tmux.conf /data/
RUN ln -s /data/tmux.conf /home/weechat/.tmux.conf
## Make Weechat configuration persistent
RUN mkdir /data/weechat
RUN chown -R weechat:weechat /data/weechat
RUN ln -s /data/weechat /home/weechat/.weechat
## Final steps
# Add Volume under /data
#VOLUME ["/data"]
# Expose port 22
EXPOSE 22
# Startup preocedure
CMD ["/bin/sh", "/usr/sbin/startup.sh"]