save & load instead of build again

This commit is contained in:
Kirigaya Kazuto 2022-02-05 23:59:25 +00:00
parent 5a582b879c
commit 50ff7c041b
2 changed files with 4 additions and 8 deletions

View File

@ -63,14 +63,12 @@ else
echo "[WARN] gost hash mismatch: $LOCAL_GOST_HASH. Expected: $VERIFIED_GOST_HASH" echo "[WARN] gost hash mismatch: $LOCAL_GOST_HASH. Expected: $VERIFIED_GOST_HASH"
fi fi
sudo podman build . -f DockerfileBase -t wg-ops-base:latest
sudo podman build . -f DockerfileBuildEnv -t wg-ops-buildenv:latest
sudo podman build . -f DockerfileRunEnv -t wg-ops-runenv:latest
podman build . -f DockerfileBase -t wg-ops-base:latest podman build . -f DockerfileBase -t wg-ops-base:latest
podman build . -f DockerfileBuildEnv -t wg-ops-buildenv:latest podman build . -f DockerfileBuildEnv -t wg-ops-buildenv:latest
podman build . -f DockerfileRunEnv -t wg-ops-runenv:latest podman build . -f DockerfileRunEnv -t wg-ops-runenv:latest
podman save wg-ops-runenv:latest | sudo podman load
CONTAINER_ID=$(podman run --rm -it -v ./bin:/root/bin -d wg-ops-buildenv) CONTAINER_ID=$(podman run --rm -it -v ./bin:/root/bin -d wg-ops-buildenv)
podman cp mux.c $CONTAINER_ID:/root/ podman cp mux.c $CONTAINER_ID:/root/
podman exec -it $CONTAINER_ID bash -c "cd /root && gcc -O3 -o bin/mux mux.c" podman exec -it $CONTAINER_ID bash -c "cd /root && gcc -O3 -o bin/mux mux.c"

View File

@ -62,14 +62,12 @@ else
echo "[WARN] gost hash mismatch: $LOCAL_GOST_HASH. Expected: $VERIFIED_GOST_HASH" echo "[WARN] gost hash mismatch: $LOCAL_GOST_HASH. Expected: $VERIFIED_GOST_HASH"
fi fi
sudo podman build . -f DockerfileBaseCN -t wg-ops-base:latest
sudo podman build . -f DockerfileBuildEnv -t wg-ops-buildenv:latest
sudo podman build . -f DockerfileRunEnv -t wg-ops-runenv:latest
podman build . -f DockerfileBaseCN -t wg-ops-base:latest podman build . -f DockerfileBaseCN -t wg-ops-base:latest
podman build . -f DockerfileBuildEnv -t wg-ops-buildenv:latest podman build . -f DockerfileBuildEnv -t wg-ops-buildenv:latest
podman build . -f DockerfileRunEnv -t wg-ops-runenv:latest podman build . -f DockerfileRunEnv -t wg-ops-runenv:latest
podman save wg-ops-runenv:latest | sudo podman load
CONTAINER_ID=$(podman run --rm -it -v ./bin:/root/bin -d wg-ops-buildenv) CONTAINER_ID=$(podman run --rm -it -v ./bin:/root/bin -d wg-ops-buildenv)
podman cp mux.c $CONTAINER_ID:/root/ podman cp mux.c $CONTAINER_ID:/root/
podman exec -it $CONTAINER_ID bash -c "cd /root && gcc -O3 -o bin/mux mux.c" podman exec -it $CONTAINER_ID bash -c "cd /root && gcc -O3 -o bin/mux mux.c"