Skip to content

Commit 9c62632

Browse files
committed
fix: fit dockerfile for goreleaser
1 parent ea741b8 commit 9c62632

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

.goreleaser.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ before:
55
hooks:
66
- make mod
77
- bash build/scripts/wintun.sh
8+
- bash build/scripts/docker.sh
89
builds:
910
- id: "ktctl"
1011
main: ./cmd/ktctl/main.go
@@ -49,7 +50,7 @@ dockers:
4950
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-shadow:latest"
5051
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-shadow:{{ .Tag }}"
5152
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-shadow:v{{ .Major }}"
52-
dockerfile: build/docker/shadow/Dockerfile
53+
dockerfile: artifacts/docker/shadow/Dockerfile
5354
skip_push: false
5455
extra_files:
5556
- build/docker/shadow/run.sh
@@ -62,7 +63,7 @@ dockers:
6263
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-router:latest"
6364
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-router:{{ .Tag }}"
6465
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-router:v{{ .Major }}"
65-
dockerfile: build/docker/router/Dockerfile
66+
dockerfile: artifacts/docker/router/Dockerfile
6667
skip_push: false
6768
extra_files:
6869
- build/docker/router/nginx.conf
@@ -74,7 +75,7 @@ dockers:
7475
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-navigator:latest"
7576
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-navigator:{{ .Tag }}"
7677
- "registry.cn-hangzhou.aliyuncs.com/rdc-incubator/kt-connect-navigator:v{{ .Major }}"
77-
dockerfile: build/docker/navigator/Dockerfile
78+
dockerfile: artifacts/docker/navigator/Dockerfile
7879
skip_push: false
7980
extra_files:
8081
- build/docker/navigator/setup_iptables.sh

build/scripts/docker.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Fit dockerfile for goreleaser
2+
3+
for f in `ls build/docker`; do
4+
mkdir -p artifacts/docker/${f}
5+
cp -f build/docker/${f}/Dockerfile artifacts/docker/${f}/Dockerfile
6+
if ! which gsed 2>&1 >/dev/null; then
7+
# Linux
8+
sed -i 's#COPY artifacts/[a-z0-1]\+/#COPY #' artifacts/docker/${f}/Dockerfile
9+
else
10+
# MacOS
11+
gsed -i 's#COPY artifacts/[a-z0-1]\+/#COPY #' artifacts/docker/${f}/Dockerfile
12+
fi
13+
done

build/scripts/wintun.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Download and unzip wintun libraries
2+
13
mkdir -p artifacts
24
wget -O artifacts/wintun.zip https://www.wintun.net/builds/wintun-0.14.1.zip
35

0 commit comments

Comments
 (0)