From b82a257df3c680aa8e0566cd14289c556238e4ad Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 28 Nov 2022 01:27:58 +0100 Subject: [PATCH 1/8] test new build ci image --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index dc193bc..bbafe98 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,7 +3,7 @@ name: test-docker-build steps: - name: test-docker-build - image: plugins/docker + image: banzaicloud/drone-kaniko settings: repo: foo/bar dry_run: true From b60ab8b2ded1ddfff1d7fb816e448402ebf7b6b7 Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 28 Nov 2022 01:28:51 +0100 Subject: [PATCH 2/8] test --- .drone.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index bbafe98..bbe53a9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,12 +2,11 @@ kind: pipeline name: test-docker-build steps: -- name: test-docker-build - image: banzaicloud/drone-kaniko - settings: - repo: foo/bar - dry_run: true - target: final - tags: - - ${DRONE_COMMIT_SHA} - - ${DRONE_BRANCH} + - name: test-docker-build + image: banzaicloud/drone-kaniko + settings: + dry_run: true + target: final + tags: + - ${DRONE_COMMIT_SHA} + - ${DRONE_BRANCH} From 39aaf00a6fb5506dd1196f2ba1b52206da9b1550 Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 28 Nov 2022 01:34:05 +0100 Subject: [PATCH 3/8] retry --- .drone.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index bbe53a9..c85496b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,9 +3,10 @@ name: test-docker-build steps: - name: test-docker-build - image: banzaicloud/drone-kaniko + image: plugins/docker settings: dry_run: true + repo: test/test target: final tags: - ${DRONE_COMMIT_SHA} From f13b3c80defc69afeb69811db669544b78e5dbfd Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 28 Nov 2022 01:49:34 +0100 Subject: [PATCH 4/8] try custom_dns in config file --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index c85496b..e7745e1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,6 +8,7 @@ steps: dry_run: true repo: test/test target: final + custom_dns: [ 116.202.204.30 ] tags: - ${DRONE_COMMIT_SHA} - ${DRONE_BRANCH} From 1390c2b97fd6f150f276082442f61ce6449ab05b Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 28 Nov 2022 01:57:37 +0100 Subject: [PATCH 5/8] try diff image --- .drone.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index e7745e1..e5195d2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,7 +3,8 @@ name: test-docker-build steps: - name: test-docker-build - image: plugins/docker + #image: plugins/docker + image: banzaicloud/drone-kaniko settings: dry_run: true repo: test/test From f6d2579b5143a39e3d2093a6094011ae74581653 Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 28 Nov 2022 02:00:45 +0100 Subject: [PATCH 6/8] trying third image --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index e5195d2..77154f2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ name: test-docker-build steps: - name: test-docker-build #image: plugins/docker - image: banzaicloud/drone-kaniko + image: plugins/kaniko settings: dry_run: true repo: test/test From 2cb70e2fe713a622f2f58bead6508e17c2d99f7c Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 28 Nov 2022 02:02:40 +0100 Subject: [PATCH 7/8] new image needs diff config --- .drone.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.drone.yml b/.drone.yml index 77154f2..8eaec59 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,6 +10,10 @@ steps: repo: test/test target: final custom_dns: [ 116.202.204.30 ] + username: + from_secret: registry_username + password: + from_secret: registry_password tags: - ${DRONE_COMMIT_SHA} - ${DRONE_BRANCH} From b78ec08cd1faf17e4a8553ccea4e27d6d48b9b7f Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 28 Nov 2022 02:06:30 +0100 Subject: [PATCH 8/8] fix --- .drone.yml | 28 +++++++++++++--------------- Dockerfile | 10 +++++----- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8eaec59..eb6f168 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,19 +1,17 @@ kind: pipeline name: test-docker-build + steps: - - name: test-docker-build - #image: plugins/docker - image: plugins/kaniko - settings: - dry_run: true - repo: test/test - target: final - custom_dns: [ 116.202.204.30 ] - username: - from_secret: registry_username - password: - from_secret: registry_password - tags: - - ${DRONE_COMMIT_SHA} - - ${DRONE_BRANCH} +- name: test + image: docker:dind + volumes: + - name: dockersock + path: /var/run/docker.sock + commands: + #- echo nameserver 116.202.204.30 > /etc/resolv.conf + - docker build -t sneak/gohttpserver . +volumes: +- name: dockersock + host: + path: /var/run/docker.sock diff --git a/Dockerfile b/Dockerfile index 414be5e..e887df1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ## lint image -FROM golangci/golangci-lint@sha256:9ae3767101cd3468cdaea5b6573dadb358013e05ac38abe37d53646680fd386c AS linter +FROM golangci/golangci-lint:v1.50.1 RUN mkdir -p /build WORKDIR /build @@ -7,7 +7,7 @@ COPY ./ ./ RUN golangci-lint run ## build image: -FROM golang:1.15-buster AS builder +FROM golang:1.19.3-bullseye AS builder RUN apt update && apt install -y make bzip2 @@ -20,14 +20,14 @@ RUN go mod download COPY ./ ./ #RUN make lint -RUN make rice-install && make httpd +RUN make httpd && mv ./httpd /httpd RUN go mod vendor RUN tar -c . | bzip2 > /src.tbz2 ## output image: -FROM debian:buster-slim AS final +FROM debian:bullseye-slim AS final COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=builder /build/httpd /app/httpd +COPY --from=builder /httpd /app/httpd COPY --from=builder /src.tbz2 /usr/local/src/src.tbz2