forked from PHLAK/docker-soxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (28 loc) · 864 Bytes
/
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
FROM alpine:3.13.5
LABEL maintainer="Chris Kankiewicz <[email protected]>"
# Create non-root user
RUN adduser -Ds /sbin/nologin soxy
# Create key directory
RUN mkdir -pv /vol/key \
&& chown soxy:soxy -R /vol \
&& chmod 700 /vol/key
# Create Soxy SSH directory & config file
# RUN mkdir -pv /home/soxy/.ssh
COPY files/config /home/soxy/.ssh/config
RUN chown soxy:soxy -R /home/soxy/.ssh \
&& chmod 700 /home/soxy/.ssh \
&& chmod 600 /home/soxy/.ssh/config
# Create keygen command
COPY files/keygen /usr/local/bin/keygen
RUN chmod +x /usr/local/bin/keygen
# Install OpenSSH Client
RUN apk add --update openssh-client \
&& rm -rf /var/cache/apk/*
# Set running user
USER soxy
# Define volumes
VOLUME /vol/key
# Set the working dir
WORKDIR /home/soxy
# Set the entrypoint
ENTRYPOINT ["ssh", "-v", "-C", "-N", "-D", "0.0.0.0:1080"]