From b78ec08cd1faf17e4a8553ccea4e27d6d48b9b7f Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 28 Nov 2022 02:06:30 +0100 Subject: [PATCH] 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