Update Dockerfile
This commit is contained in:
parent
04fc920a50
commit
36f64fa1b0
11
Dockerfile
11
Dockerfile
@ -6,17 +6,20 @@ RUN apt-get update && apt-get upgrade -y && \
|
|||||||
|
|
||||||
# Create user and set password for user and root user
|
# Create user and set password for user and root user
|
||||||
RUN useradd -rm -d /home/code -s /bin/bash -g root -G sudo -u 1000 code && \
|
RUN useradd -rm -d /home/code -s /bin/bash -g root -G sudo -u 1000 code && \
|
||||||
echo 'code:changethis' | chpasswd && \
|
echo 'code:changethis' | chpasswd
|
||||||
echo 'root:changethis' | chpasswd
|
|
||||||
|
|
||||||
# Set up configuration for SSH
|
# Set up configuration for SSH
|
||||||
RUN mkdir /var/run/sshd && \
|
RUN mkdir /var/run/sshd && \
|
||||||
sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
|
|
||||||
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \
|
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \
|
||||||
echo "export VISIBLE=now" >> /etc/profile
|
echo "export VISIBLE=now" >> /etc/profile
|
||||||
|
|
||||||
# Expose the SSH port
|
# Expose the SSH port
|
||||||
EXPOSE 22
|
EXPOSE 22
|
||||||
|
|
||||||
|
# Add firstrun.sh to runit
|
||||||
|
ADD dockerrun.sh /dockerrun.sh
|
||||||
|
RUN chmod +x /dockerrun.sh
|
||||||
|
|
||||||
# Run SSH
|
# Run SSH
|
||||||
CMD ["/usr/sbin/sshd", "-D"]
|
#CMD ["/usr/sbin/sshd", "-D"]
|
||||||
|
CMD ["/dockerrun.sh"]
|
||||||
Loading…
x
Reference in New Issue
Block a user