-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
31 lines (23 loc) · 927 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
FROM ghcr.io/huggingface/text-generation-inference:2.4.0
# Copy entrypoint script and set permissions
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Use Conda to install openssh
RUN conda install -y openssh
# Create the /etc/ssh directory and configure SSH server settings
RUN mkdir -p /etc/ssh && \
echo "Port 22" >> /opt/conda/etc/sshd_config && \
echo "PasswordAuthentication yes" >> /opt/conda/etc/sshd_config && \
echo "PermitRootLogin yes" >> /opt/conda/etc/sshd_config
# Add the sshd privilege separation user
RUN useradd -r -s /usr/sbin/nologin sshd
# Create /var/empty directory for privilege separation
RUN mkdir -p /var/empty && \
chown root:root /var/empty && \
chmod 700 /var/empty
# Expose SSH port
EXPOSE 22
# Set default password environment variable
ENV PASSWORD="PASSWORD"
# Use JSON syntax for ENTRYPOINT to prevent OS signal issues
ENTRYPOINT ["/entrypoint.sh"]