From 5b031b12ce50076501c75123403056de80878a2b Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sat, 15 Jan 2022 10:31:11 +0100 Subject: [PATCH 1/7] Added missing compiler flags to Dockerfile --- .woodpecker/.publish.yml | 9 +++++---- Dockerfile | 7 ++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.woodpecker/.publish.yml b/.woodpecker/.publish.yml index d23f63c..f94832a 100644 --- a/.woodpecker/.publish.yml +++ b/.woodpecker/.publish.yml @@ -1,13 +1,14 @@ -branches: [main, dev] +# branches: [main, dev] platform: linux/amd64 pipeline: dev: - image: plugins/docker + image: woodpeckerci/plugin-docker-buildx secrets: [ docker_username, docker_password ] settings: repo: chewingbever/vieter tag: dev + platforms: [ linux/arm/v7, linux/arm64/v8, linux/amd64 ] when: event: push branch: dev @@ -25,5 +26,5 @@ pipeline: event: tag branch: main -depends_on: - - builder +# depends_on: +# - builder diff --git a/Dockerfile b/Dockerfile index 556ca58..4ca6c87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,17 +5,14 @@ WORKDIR /app # Copy over source code & build production binary COPY src ./src COPY Makefile ./ -RUN make prod +RUN LDFLAGS='-lz -lbz2 -llzma -lexpat -lzstd -llz4 -static' \ + make prod FROM alpine:3.15 ENV REPO_DIR=/data -RUN apk update && \ - apk add --no-cache \ - libarchive - COPY --from=builder /app/pvieter /usr/local/bin/vieter ENTRYPOINT [ "/usr/local/bin/vieter" ] From 72699725d03e4ac5e053276987422413614152fe Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sat, 15 Jan 2022 10:31:54 +0100 Subject: [PATCH 2/7] Missed a constraint --- .woodpecker/.publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker/.publish.yml b/.woodpecker/.publish.yml index f94832a..dd0674f 100644 --- a/.woodpecker/.publish.yml +++ b/.woodpecker/.publish.yml @@ -11,7 +11,7 @@ pipeline: platforms: [ linux/arm/v7, linux/arm64/v8, linux/amd64 ] when: event: push - branch: dev + # branch: dev release: image: plugins/docker From ce1e46e2d60f7822a932d6194887da16952ae203 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sat, 15 Jan 2022 10:36:23 +0100 Subject: [PATCH 3/7] Changed to ENV call --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4ca6c87..e24f909 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,9 @@ WORKDIR /app # Copy over source code & build production binary COPY src ./src COPY Makefile ./ -RUN LDFLAGS='-lz -lbz2 -llzma -lexpat -lzstd -llz4 -static' \ - make prod + +ENV LDFLAGS='-lz -lbz2 -llzma -lexpat -lzstd -llz4 -static' +RUN make prod FROM alpine:3.15 From 964fefc7ee6c4952c7fd2fd58f02d1bae05f03e2 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sat, 15 Jan 2022 10:39:06 +0100 Subject: [PATCH 4/7] Removed arm/v7 --- .woodpecker/.publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker/.publish.yml b/.woodpecker/.publish.yml index dd0674f..3a4b150 100644 --- a/.woodpecker/.publish.yml +++ b/.woodpecker/.publish.yml @@ -8,7 +8,7 @@ pipeline: settings: repo: chewingbever/vieter tag: dev - platforms: [ linux/arm/v7, linux/arm64/v8, linux/amd64 ] + platforms: [ linux/arm64/v8, linux/amd64 ] when: event: push # branch: dev From 759dfa6b08b5d543a01155b1771bd2da53f68c4d Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sat, 15 Jan 2022 11:16:09 +0100 Subject: [PATCH 5/7] Changed up Dockerfile optimisation --- Dockerfile | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e24f909..f244847 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ COPY src ./src COPY Makefile ./ ENV LDFLAGS='-lz -lbz2 -llzma -lexpat -lzstd -llz4 -static' -RUN make prod +RUN v -o pvieter -clags "-O3" src FROM alpine:3.15 diff --git a/Makefile b/Makefile index 103aca6..dc2273b 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ LARCHIVE_LIB := $(LARCHIVE_DIR)/libarchive/libarchive.so # Custom V command for linking libarchive # V := LDFLAGS=$(PWD)/$(LARCHIVE_LIB) v -cflags '-I$(PWD)/$(LARCHIVE_DIR) -I $(PWD)/$(LARCHIVE_DIR)' -V := v +V := v -showcc all: vieter From 87f7caea2b9a8d6679e8dead6b4ff5331d5f1ba5 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sat, 15 Jan 2022 11:18:05 +0100 Subject: [PATCH 6/7] Another typo --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f244847..5564e34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ COPY src ./src COPY Makefile ./ ENV LDFLAGS='-lz -lbz2 -llzma -lexpat -lzstd -llz4 -static' -RUN v -o pvieter -clags "-O3" src +RUN v -o pvieter -cflags "-O3" src FROM alpine:3.15 From 2dd9ea4553e0f5ae7fbe77c876948be646487e14 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Sat, 15 Jan 2022 11:35:29 +0100 Subject: [PATCH 7/7] Re-added necessary constraints --- .woodpecker/.publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.woodpecker/.publish.yml b/.woodpecker/.publish.yml index 3a4b150..6399d7f 100644 --- a/.woodpecker/.publish.yml +++ b/.woodpecker/.publish.yml @@ -1,4 +1,4 @@ -# branches: [main, dev] +branches: [main, dev] platform: linux/amd64 pipeline: @@ -11,20 +11,20 @@ pipeline: platforms: [ linux/arm64/v8, linux/amd64 ] when: event: push - # branch: dev + branch: dev release: - image: plugins/docker + image: woodpeckerci/plugin-docker-buildx secrets: [ docker_username, docker_password ] settings: repo: chewingbever/vieter tag: - latest - $CI_COMMIT_TAG - mtu: 1000 + platforms: [ linux/arm64/v8, linux/amd64 ] when: event: tag branch: main -# depends_on: -# - builder +depends_on: + - builder