调整运行指令

This commit is contained in:
liu.chunxun 2024-08-21 14:21:59 +08:00
parent 5511fe0282
commit 16550480ac
2 changed files with 11 additions and 5 deletions

View File

@ -1,15 +1,17 @@
FROM dockerproxy.com/library/ubuntu:22.04
ADD dotnet-runtime-3.1.32-linux-x64.tar.gz /root/dotnet
COPY libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb /tmp
COPY nats-server /usr/bin/
COPY checksum /usr/bin/
COPY yuzhen_iot /yuzhen_iot/
COPY start.sh /home/
RUN apt update;dpkg --add-architecture i386;apt update;apt install -y --no-install-recommends libstdc++6 lib32stdc++6 libc6:i386 libc6 libgcc-s1 libicu70 liblttng-ust1 zlib1g vim zip unzip wget openssh-server inetutils-ping inetutils-telnet;\
dpkg -i /tmp/libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb;\
echo "PermitRootLogin yes\nPasswordAuthentication yes\n" >> /etc/ssh/sshd_config;\
echo root:123456 |chpasswd
COPY nats-server /usr/bin/
COPY checksum /usr/bin/
COPY yuzhen_iot /yuzhen_iot/
COPY start.sh /home/
WORKDIR /home
CMD ["/home/start.sh"]

View File

@ -6,11 +6,15 @@
### docker 运行命令
`docker run -p 51001:51001/udp 51002:51002/udp -v /path/Prod_connect.json:/yuzhen_iot/prod_manage/cfg/Prod_connect.json gitiot.mgm-iot.com/iot_images/yuzhen_base:v1.0.4`
`docker run -d --name yzcol --restart always -v /etc/localtime:/etc/localtime gitiot.mgm-iot.com/iot_images/yuzhen_base:v1.0.4`
* -p 51001:51001/udp ,透传UDP端口
* -p 51001-51099:51001-51099/udp ,透传UDP端口
* -v 挂在配置文件
* --name 容器名称,便于查找
* --restart always ,自动重启
* -d 后台运行
* -v /etc/localtime:/etc/localtime ,保持和主机相同时区
### 设置自动重启
`docker update --restart=always ${CONTAINER}`