Update Dockerfile
This commit is contained in:
parent
f40f3acfed
commit
5f081886dc
@ -2,13 +2,12 @@ FROM ubuntu:22.04
|
|||||||
|
|
||||||
# Update the system, install OpenSSH Server, and set up users
|
# Update the system, install OpenSSH Server, and set up users
|
||||||
RUN apt-get update && apt-get upgrade -y && \
|
RUN apt-get update && apt-get upgrade -y && \
|
||||||
apt-get install -y openssh-server git
|
apt-get install -y openssh-server git sudo
|
||||||
|
|
||||||
# Create user and set password for user and root user
|
# Create user and set password for user and root user
|
||||||
ARG CODE_PASSWORD
|
ARG CODE_PASSWORD
|
||||||
ENV CODE_PASSWORD=$CODE_PASSWORD
|
|
||||||
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:$CODE_PASSWORD' | chpasswd
|
echo 'code:'$CODE_PASSWORD | chpasswd
|
||||||
|
|
||||||
# Set up configuration for SSH
|
# Set up configuration for SSH
|
||||||
RUN mkdir /var/run/sshd && \
|
RUN mkdir /var/run/sshd && \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user