syscall commited on
Commit
ea0b43d
·
verified ·
1 Parent(s): 3d0ca4e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -35
Dockerfile CHANGED
@@ -1,36 +1,10 @@
 
1
  services:
2
- centos7-ssh:
3
- build:
4
- context: .
5
- dockerfile_inline: |
6
- FROM centos:7
7
-
8
- # 1. 修复 CentOS 7 因 EOL 导致的 yum 源 404 问题(切换至官方 Vault 归档源)
9
- RUN sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/CentOS-*.repo && \
10
- sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/CentOS-*.repo && \
11
- sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/CentOS-*.repo
12
-
13
- # 2. 安装 SSH 服务端及常用工具
14
- RUN yum install -y openssh-server openssh-clients sudo && \
15
- yum clean all
16
-
17
- # 3. 生成 SSH 所需的主机密钥对
18
- RUN ssh-keygen -A
19
-
20
- # 4. 设置 root 用户的密码为 admin
21
- RUN echo 'root:admin' | chpasswd
22
-
23
- # 5. 修改 SSH 配置,允许 root 密码登录
24
- RUN sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config && \
25
- sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
26
-
27
- # 开放 22 端口
28
- EXPOSE 22
29
-
30
- # 前台运行 sshd 服务
31
- CMD ["/usr/sbin/sshd", "-D"]
32
-
33
- container_name: my_centos7_ssh
34
- ports:
35
- - "8022:22"
36
- restart: always
 
1
+ version: '3'
2
  services:
3
+ unicom-sms:
4
+ image: fenglongchang/liantong-unicom-sms:latest
5
+ container_name: unicom_token_helper
6
+ ports:
7
+ - "5001:5001"
8
+ restart: always
9
+ environment:
10
+ - TZ=Asia/Shanghai