try same OS for build/run images, per feedback #2
@ -7,6 +7,7 @@ steps:
|
|||||||
settings:
|
settings:
|
||||||
repo: foo/bar
|
repo: foo/bar
|
||||||
dry_run: true
|
dry_run: true
|
||||||
|
target: final
|
||||||
tags:
|
tags:
|
||||||
- ${DRONE_COMMIT_SHA}
|
- ${DRONE_COMMIT_SHA}
|
||||||
- ${DRONE_BRANCH}
|
- ${DRONE_BRANCH}
|
||||||
|
12
Dockerfile
12
Dockerfile
@ -7,15 +7,9 @@ COPY ./ ./
|
|||||||
RUN golangci-lint run
|
RUN golangci-lint run
|
||||||
|
|
||||||
## build image:
|
## build image:
|
||||||
#ARG GO_VERSION=1.15
|
FROM golang:1.15-buster AS builder
|
||||||
FROM golang:1.15-alpine AS builder
|
|
||||||
|
|
||||||
RUN mkdir /user && \
|
RUN apt update && apt install -y make bzip2
|
||||||
echo 'nobody:x:65534:65534:nobody:/:' > /user/passwd && \
|
|
||||||
echo 'nobody:x:65534:' > /user/group
|
|
||||||
RUN apk add --no-cache ca-certificates git bzip2 make gcc libc-dev
|
|
||||||
|
|
||||||
#RUN GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.31.0
|
|
||||||
|
|
||||||
RUN mkdir -p /build
|
RUN mkdir -p /build
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
@ -32,7 +26,7 @@ RUN go mod vendor
|
|||||||
RUN tar -c . | bzip2 > /src.tbz2
|
RUN tar -c . | bzip2 > /src.tbz2
|
||||||
|
|
||||||
## output image:
|
## output image:
|
||||||
FROM ubuntu:focal 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 /build/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