ssh-deploy/test/Dockerfile

12 lines
308 B
Docker
Raw Normal View History

2022-12-30 01:14:51 +03:00
FROM nginx
# Set args to get from Gtihub Action
ARG ssh_pub_key
ARG ssh_user
# Add a user to the container
2022-12-30 12:29:20 +03:00
RUN adduser --disabled-password $ssh_user
2022-12-30 01:14:51 +03:00
USER $ssh_user
# Add the ssh public key to the container
RUN mkdir -p $HOME/.ssh
RUN echo "$ssh_pub_key" > $HOME/.ssh/authorized_keys
RUN chmod 700 $HOME/.ssh