From 16550480ac73a833a8feb29d2e1ed1d92eb83290 Mon Sep 17 00:00:00 2001 From: "liu.chunxun" Date: Wed, 21 Aug 2024 14:21:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=BF=90=E8=A1=8C=E6=8C=87?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 10 ++++++---- README.md | 6 +++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 68e9412..3b0d096 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index 238e681..52c7581 100644 --- a/README.md +++ b/README.md @@ -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}` \ No newline at end of file