File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77DUMP=wsl-vpnkit.wsl # exported rootfs file
88TAG_NAME=wslvpnkit # build tag
99BASE_DISTRO=$1
10+ UPDATE_CHECKSUMS=$2
1011
11- # build
1212build_args=()
1313[ -z " ${http_proxy} " ] || build_args+=( --build-arg http_proxy=" ${http_proxy} " )
1414[ -z " ${https_proxy} " ] || build_args+=( --build-arg https_proxy=" ${https_proxy} " )
1515[ -z " ${no_proxy} " ] || build_args+=( --build-arg no_proxy=" ${no_proxy} " )
16- ${DOCKER} build --network host " ${build_args[@]} " --tag ${TAG_NAME} --file ./distro/$BASE_DISTRO .dockerfile .
17- CONTAINER_ID=$( ${DOCKER} create ${TAG_NAME} )
18- ${DOCKER} export " ${CONTAINER_ID} " | gzip > ${DUMP}
16+
17+ if [ " ${UPDATE_CHECKSUMS} " = " update-checksums" ]; then
18+ CHECKSUM_TAG=" ${TAG_NAME} -checksum"
19+
20+ ${DOCKER} build --network host " ${build_args[@]} " --target gvisor-tap-vsock-arm64 \
21+ --tag " ${CHECKSUM_TAG} " --file " ./distro/${BASE_DISTRO} .dockerfile" .
22+ GVFORWARDER_CHECKSUM=$( ${DOCKER} run --rm " ${CHECKSUM_TAG} " sha256sum /app/bin/gvforwarder | cut -d ' ' -f1)
23+ [ " $( grep -Ec ' ^[[:xdigit:]]+[[:space:]]+\./bin/arm64/gvforwarder$' distro/checksums) " -eq 1 ]
24+ sed -i -E " s|^[[:xdigit:]]+[[:space:]]+\\ ./bin/arm64/gvforwarder\$ |${GVFORWARDER_CHECKSUM} ./bin/arm64/gvforwarder|" distro/checksums
25+ fi
26+
27+ # build
28+ ${DOCKER} build --network host " ${build_args[@]} " --tag " ${TAG_NAME} " --file " ./distro/${BASE_DISTRO} .dockerfile" .
29+ CONTAINER_ID=$( ${DOCKER} create " ${TAG_NAME} " )
30+ ${DOCKER} export " ${CONTAINER_ID} " | gzip > " ${DUMP} "
1931${DOCKER} container rm " ${CONTAINER_ID} "
20- ls -la ${DUMP}
32+ ls -la " ${DUMP} "
You can’t perform that action at this time.
0 commit comments