-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix service script #169
Fix service script #169
Changes from 11 commits
9ab4b10
1159cf2
21bdf0f
ee37ea4
30f32c5
c25de3d
c0eb182
78eccf4
dabf5de
8a62d7c
9decf7b
3e8e1e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
#! /bin/sh -xe | ||
#!/bin/bash -xe | ||
|
||
# run from repo root | ||
# ./build.sh | ||
|
||
USERPROFILE="$(powershell.exe -c 'Write-Host -NoNewline $env:USERPROFILE')" | ||
DUMP=wsl-vpnkit.tar.gz | ||
TAG_NAME=wslvpnkit | ||
: "${DOCKER:=docker}" # docker/podman command (default: docker) | ||
DUMP=wsl-vpnkit.tar.gz # exported rootfs file | ||
TAG_NAME=wslvpnkit # build tag | ||
|
||
# build | ||
docker build -t $TAG_NAME -f ./distro/Dockerfile . | ||
CONTAINER_ID=$(docker create $TAG_NAME) | ||
docker export $CONTAINER_ID | gzip > $DUMP | ||
docker container rm $CONTAINER_ID | ||
ls -la $DUMP | ||
|
||
# reinstall | ||
wsl.exe --unregister wsl-vpnkit || : | ||
wsl.exe --import wsl-vpnkit --version 2 "$USERPROFILE\\wsl-vpnkit" $DUMP | ||
rm $DUMP | ||
build_args=() | ||
[ -z "${http_proxy}" ] || build_args+=( --build-arg http_proxy="${http_proxy}" ) | ||
[ -z "${https_proxy}" ] || build_args+=( --build-arg https_proxy="${https_proxy}" ) | ||
[ -z "${no_proxy}" ] || build_args+=( --build-arg no_proxy="${no_proxy}" ) | ||
${DOCKER} build --network host "${build_args[@]}" --tag ${TAG_NAME} --file ./distro/Dockerfile . | ||
CONTAINER_ID=$(${DOCKER} create ${TAG_NAME}) | ||
${DOCKER} export "${CONTAINER_ID}" | gzip > ${DUMP} | ||
${DOCKER} container rm "${CONTAINER_ID}" | ||
ls -la ${DUMP} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.18.8-alpine3.16 as build | ||
FROM docker.io/library/golang:1.18.8-alpine3.16 as build | ||
WORKDIR /app | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
@@ -8,7 +8,7 @@ RUN GOOS=windows go build -ldflags '-H=windowsgui' -o bin/wsl-gvproxy.exe ./cmd/ | |
GOOS=linux CGO_ENABLED=0 go build -ldflags '-s -w' -o bin/wsl-vm ./cmd/vm && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added as comment |
||
find ./bin -type f -exec sha256sum {} \; | ||
|
||
FROM golang:1.18.8-alpine3.16 as licenses | ||
FROM docker.io/library/golang:1.18.8-alpine3.16 as licenses | ||
RUN apk add --no-cache git && \ | ||
apk list --installed && \ | ||
go install github.com/google/[email protected] | ||
|
@@ -19,7 +19,7 @@ COPY pkg ./pkg | |
RUN go-licenses save ./cmd/gvproxy --save_path ./licenses/gvproxy && \ | ||
go-licenses save ./cmd/vm --save_path ./licenses/vm | ||
|
||
FROM alpine:3.16.3 | ||
FROM docker.io/library/alpine:3.16.3 | ||
RUN apk add --no-cache openrc iptables && \ | ||
apk list --installed | ||
ARG REF=https://example.com/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash -xe | ||
|
||
# run from repo root | ||
# ./import.sh | ||
|
||
USERPROFILE=$(wslvar USERPROFILE) | ||
DUMP=wsl-vpnkit.tar.gz | ||
|
||
# build if necessary | ||
[ -f ${DUMP} ] || ./build.sh | ||
|
||
# reinstall | ||
wsl.exe --unregister wsl-vpnkit || : | ||
wsl.exe --import wsl-vpnkit --version 2 "${USERPROFILE}\\wsl-vpnkit" ${DUMP} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍