-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
24 lines (24 loc) · 989 Bytes
/
docker-compose.yaml
File metadata and controls
24 lines (24 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
services:
ssh-server:
build:
context: .
dockerfile_inline: |
FROM ubuntu:22.04@sha256:01a3ee0b5e413cefaaffc6abe68c9c37879ae3cced56a8e088b1649e5b269eee
RUN apt-get update && apt-get install -y openssh-server sudo
RUN mkdir /run/sshd
RUN echo 'root:${ROOT_PW:-123456}' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
RUN sed -i 's/#Port 22/Port 1022/' /etc/ssh/sshd_config
EXPOSE 1022
CMD ["/usr/sbin/sshd", "-D"]
restart: unless-stopped
privileged: true
network_mode: host
volumes:
- /:/host/
- /var/run/tappd.sock:/var/run/tappd.sock
- /var/run/docker.sock:/var/run/docker.sock
workload:
image: nginx