Compare commits
No commits in common. "0c3797ec30b547174df0ac6f2ea144cd6c1a4990" and "61228b4586da20cbc8c6fcf49bf4dfb69185faa0" have entirely different histories.
0c3797ec30
...
61228b4586
22
.drone.yml
22
.drone.yml
@ -1,17 +1,13 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: test-docker-build
|
name: test-docker-build
|
||||||
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: test
|
- name: test-docker-build
|
||||||
image: docker:dind
|
image: plugins/docker
|
||||||
volumes:
|
settings:
|
||||||
- name: dockersock
|
repo: foo/bar
|
||||||
path: /var/run/docker.sock
|
dry_run: true
|
||||||
commands:
|
target: final
|
||||||
#- echo nameserver 116.202.204.30 > /etc/resolv.conf
|
tags:
|
||||||
- docker build -t sneak/gohttpserver .
|
- ${DRONE_COMMIT_SHA}
|
||||||
volumes:
|
- ${DRONE_BRANCH}
|
||||||
- name: dockersock
|
|
||||||
host:
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
|
10
Dockerfile
10
Dockerfile
@ -1,5 +1,5 @@
|
|||||||
## lint image
|
## lint image
|
||||||
FROM golangci/golangci-lint:v1.50.1
|
FROM golangci/golangci-lint@sha256:9ae3767101cd3468cdaea5b6573dadb358013e05ac38abe37d53646680fd386c AS linter
|
||||||
|
|
||||||
RUN mkdir -p /build
|
RUN mkdir -p /build
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
@ -7,7 +7,7 @@ COPY ./ ./
|
|||||||
RUN golangci-lint run
|
RUN golangci-lint run
|
||||||
|
|
||||||
## build image:
|
## build image:
|
||||||
FROM golang:1.19.3-bullseye AS builder
|
FROM golang:1.15-buster AS builder
|
||||||
|
|
||||||
RUN apt update && apt install -y make bzip2
|
RUN apt update && apt install -y make bzip2
|
||||||
|
|
||||||
@ -20,14 +20,14 @@ RUN go mod download
|
|||||||
|
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
#RUN make lint
|
#RUN make lint
|
||||||
RUN make httpd && mv ./httpd /httpd
|
RUN make rice-install && make httpd
|
||||||
RUN go mod vendor
|
RUN go mod vendor
|
||||||
RUN tar -c . | bzip2 > /src.tbz2
|
RUN tar -c . | bzip2 > /src.tbz2
|
||||||
|
|
||||||
## output image:
|
## output image:
|
||||||
FROM debian:bullseye-slim AS final
|
FROM debian:buster-slim AS final
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
COPY --from=builder /httpd /app/httpd
|
COPY --from=builder /build/httpd /app/httpd
|
||||||
COPY --from=builder /src.tbz2 /usr/local/src/src.tbz2
|
COPY --from=builder /src.tbz2 /usr/local/src/src.tbz2
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user