|
@@ -1,125 +0,0 @@
|
|
|
-#### usage
|
|
|
-```
|
|
|
-sudo docker restart fra-component-interface && sudo docker logs -f fra-component-interface
|
|
|
-```
|
|
|
-```
|
|
|
-# --- 试运行 ---
|
|
|
-echo "Test-Run-And-Check-Build:" \
|
|
|
-&& project_path="/home/server/projects/taiwuict/cscec-8bur-vms/component-interface" \
|
|
|
-&& cd ${project_path} \
|
|
|
-&& sudo docker-compose --file compose_test.yml down \
|
|
|
-&& sudo docker-compose --file compose_test.yml up --detach --build \
|
|
|
-&& sudo docker logs --follow test-component-interface
|
|
|
-```
|
|
|
-```
|
|
|
-# --- 试运行 ---
|
|
|
-echo "Test-Run-And-Check-Build:" \
|
|
|
-&& project_path="/home/server/projects/taiwuict/cscec-8bur-vms/component-interface" \
|
|
|
-&& cd ${project_path} \
|
|
|
-&& sudo docker-compose --file compose_test.yml down \
|
|
|
-&& sudo docker-compose --file compose_test.yml up --detach --build \
|
|
|
-&& sudo docker exec -it test-component-interface bash
|
|
|
-```
|
|
|
-```
|
|
|
-# --- 试运行 ---
|
|
|
-echo "Test-Run:" \
|
|
|
-&& project_path="/home/server/projects/taiwuict/cscec-8bur-vms/component-interface" \
|
|
|
-&& cd ${project_path} \
|
|
|
-&& sudo docker-compose --file compose_test.yml down \
|
|
|
-&& sudo docker-compose --file compose_test.yml up --detach \
|
|
|
-&& sudo docker-compose --file compose_test.yml logs --follow
|
|
|
-```
|
|
|
-```
|
|
|
-# --- 打包方式运行(压缩) ---
|
|
|
-echo "Wrap-Application:" \
|
|
|
-&& sudo docker rm -f fra-component-interface \
|
|
|
-&& sudo docker run \
|
|
|
- --tty \
|
|
|
- --env TZ=Asia/Shanghai \
|
|
|
- --volume /home:/home \
|
|
|
- --publish 8891:8000 \
|
|
|
- --network node_network \
|
|
|
- --name fra-component-interface \
|
|
|
- fra-component-interface:u20 \
|
|
|
- /bin/bash /home/server/projects/taiwuict/cscec-8bur-vms/component-interface/run-exe-wrap.sh
|
|
|
-```
|
|
|
-```
|
|
|
-# --- 打包方式运行(测试) ---
|
|
|
-echo "Run-Test:" \
|
|
|
-&& sudo docker rm -f fra-component-interface \
|
|
|
-&& sudo docker run \
|
|
|
- --tty \
|
|
|
- --env TZ=Asia/Shanghai \
|
|
|
- --volume /home:/home \
|
|
|
- --publish 8891:8000 \
|
|
|
- --network node_network \
|
|
|
- --name fra-component-interface \
|
|
|
- ubuntu:20.04 \
|
|
|
- /bin/bash /home/server/projects/taiwuict/cscec-8bur-vms/component-interface/run-exe.sh
|
|
|
-```
|
|
|
-```
|
|
|
-# --- 构建镜像并上传镜像仓库(构建) ---
|
|
|
-echo "step-1: 收集代码" \
|
|
|
-&& project_path="/home/server/projects/taiwuict/cscec-8bur-vms" \
|
|
|
-&& cd ${project_path} \
|
|
|
-&& sudo rm -rf build \
|
|
|
-&& sudo mkdir build \
|
|
|
-&& cd build \
|
|
|
-&& sudo cp -rf ../supplement-python . \
|
|
|
-&& sudo cp -rf ../component-interface . \
|
|
|
-&& sudo rm -rf component-interface/__pycache__ \
|
|
|
-&& sudo rm -rf component-interface/test \
|
|
|
-&& sudo rm -rf component-interface/*.tar \
|
|
|
-&& echo "step-2: 编译源码" \
|
|
|
-&& sudo docker run \
|
|
|
- --tty \
|
|
|
- --volume /home:/home \
|
|
|
- fra-component-interface:u20 \
|
|
|
- /bin/bash /home/server/projects/taiwuict/cscec-8bur-vms/build/component-interface/run-c.sh \
|
|
|
-&& echo "step-3: 制作镜像" \
|
|
|
-&& sudo docker build \
|
|
|
- --tag fra-component-interface:new \
|
|
|
- --file component-interface/build.Dockerfile \
|
|
|
- --no-cache \
|
|
|
- --rm \
|
|
|
- . \
|
|
|
-&& echo "End."
|
|
|
-```
|
|
|
-```
|
|
|
-# --- 容器方式运行(测试) ---
|
|
|
-echo "Run-Test:" \
|
|
|
-&& sudo docker rm -f fra-component-interface \
|
|
|
-&& sudo docker run \
|
|
|
- --detach \
|
|
|
- --env TZ=Asia/Shanghai \
|
|
|
- --volume /home:/home \
|
|
|
- --publish 8891:8000 \
|
|
|
- --network node_network \
|
|
|
- --restart always \
|
|
|
- --name fra-component-interface \
|
|
|
- fra-component-interface:new \
|
|
|
-&& sudo docker logs -f fra-component-interface
|
|
|
-```
|
|
|
-```
|
|
|
-# --- 构建镜像并上传镜像仓库(上传) ---
|
|
|
-echo "Upload-Image:" \
|
|
|
-&& locale_name="fra-component-interface:new" \
|
|
|
-&& remote_name_1="casperz/fra-component-interface:arm64" \
|
|
|
-&& remote_name_2="casperz/fra-component-interface:amd64" \
|
|
|
-&& bash /home/server/resources/HostNecessities/2022/scripts/dockerhub_login.sh \
|
|
|
-&& sudo docker tag ${locale_name} ${remote_name_1} \
|
|
|
-&& sudo docker push ${remote_name_1}
|
|
|
-```
|
|
|
-```
|
|
|
-# --- 启动容器(下载) ---
|
|
|
-sudo docker rm -f fra-component-interface \
|
|
|
-&& sudo docker run \
|
|
|
- --detach \
|
|
|
- --env TZ=Asia/Shanghai \
|
|
|
- --publish 8891:8000 \
|
|
|
- --network node_network \
|
|
|
- --restart always \
|
|
|
- --name fra-component-interface \
|
|
|
- casperz/fra-component-interface:arm64 \
|
|
|
-&& sudo docker logs -f fra-component-interface
|
|
|
-```
|