Skip to content

Commit

Permalink
fix: fit dockerfile for goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
linfan committed May 4, 2022
1 parent ea741b8 commit 9c62632
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ before:
hooks:
- make mod
- bash build/scripts/wintun.sh
- bash build/scripts/docker.sh
builds:
- id: "ktctl"
main: ./cmd/ktctl/main.go
Expand Down Expand Up @@ -49,7 +50,7 @@ dockers:
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-shadow:latest"
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-shadow:{{ .Tag }}"
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-shadow:v{{ .Major }}"
dockerfile: build/docker/shadow/Dockerfile
dockerfile: artifacts/docker/shadow/Dockerfile
skip_push: false
extra_files:
- build/docker/shadow/run.sh
Expand All @@ -62,7 +63,7 @@ dockers:
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-router:latest"
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-router:{{ .Tag }}"
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-router:v{{ .Major }}"
dockerfile: build/docker/router/Dockerfile
dockerfile: artifacts/docker/router/Dockerfile
skip_push: false
extra_files:
- build/docker/router/nginx.conf
Expand All @@ -74,7 +75,7 @@ dockers:
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-navigator:latest"
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-navigator:{{ .Tag }}"
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-navigator:v{{ .Major }}"
dockerfile: build/docker/navigator/Dockerfile
dockerfile: artifacts/docker/navigator/Dockerfile
skip_push: false
extra_files:
- build/docker/navigator/setup_iptables.sh
Expand Down
13 changes: 13 additions & 0 deletions build/scripts/docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Fit dockerfile for goreleaser

for f in `ls build/docker`; do
mkdir -p artifacts/docker/${f}
cp -f build/docker/${f}/Dockerfile artifacts/docker/${f}/Dockerfile
if ! which gsed 2>&1 >/dev/null; then
# Linux
sed -i 's#COPY artifacts/[a-z0-1]\+/#COPY #' artifacts/docker/${f}/Dockerfile
else
# MacOS
gsed -i 's#COPY artifacts/[a-z0-1]\+/#COPY #' artifacts/docker/${f}/Dockerfile
fi
done
2 changes: 2 additions & 0 deletions build/scripts/wintun.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Download and unzip wintun libraries

mkdir -p artifacts
wget -O artifacts/wintun.zip https://www.wintun.net/builds/wintun-0.14.1.zip

Expand Down

0 comments on commit 9c62632

Please sign in to comment.