Update Dockerfile
Browse files16 unmodified lines171819202122232425262728293031323334353616 unmodified lines# CMD ["docker-compose up"]FROM ubuntu:latestRUN apt update && apt install openssh-server sudo -yRUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 testRUN echo 'test:test' | chpasswdRUN ssh-keygen -ARUN service ssh startEXPOSE 22CMD ["/usr/sbin/sshd","-D"]16 unmodified lines171819202122232425262728293031323334353616 unmodified lines# CMD ["docker-compose up"]# Use a base image with an SSH server (you can choose a specific image based on your requirements)FROM ubuntu:latest# Update the package lists and install the SSH serverRUN apt-get update && apt-get install -y openssh-server# Create an SSH user (replace "sshuser" with your desired username)RUN useradd -m -d /home/sshuser -s /bin/bash sshuser# Set a password for the SSH user (replace "sshpassword" with your desired password)RUN echo 'sshuser:sshpassword' | chpasswd# Expose port 7768 for SSHEXPOSE 7768# Start the SSH server when the container runsCMD ["/usr/sbin/sshd", "-D"]
Dockerfile+11-11