2021-10-05 13:18:47 +03:00
|
|
|
# bump: docker-golang /FROM golang:([\d.]+)/ docker:golang|^1
|
2021-12-04 19:20:20 +03:00
|
|
|
FROM golang:1.17.4-bullseye AS base
|
2021-09-18 19:12:36 +03:00
|
|
|
|
|
|
|
# expect is used to test cli
|
|
|
|
RUN \
|
|
|
|
apt-get update -q && \
|
|
|
|
apt-get install --no-install-recommends -qy \
|
|
|
|
expect
|
2020-06-08 03:29:51 +03:00
|
|
|
|
|
|
|
# docker build --target dev -t fq-dev - < Dockerfile && docker run --rm -ti -v "$PWD:/$PWD" -w "$PWD" fq-dev
|
|
|
|
FROM base AS dev
|
|
|
|
|
2021-10-05 13:18:47 +03:00
|
|
|
# bump: docker-golangci-lint /GOLANGCILINT_VERSION=([\d.]+)/ git:https://github.com/golangci/golangci-lint.git|^1
|
2021-12-02 19:21:00 +03:00
|
|
|
# bump: docker-golangci-lint link "Release notes" https://github.com/golangci/golangci-lint/releases/tag/v$LATEST
|
2021-11-03 19:20:35 +03:00
|
|
|
ARG GOLANGCILINT_VERSION=1.43.0
|
2020-06-08 03:29:51 +03:00
|
|
|
RUN \
|
|
|
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
|
|
|
|
sh -s -- -b /usr/local/bin v$GOLANGCILINT_VERSION
|
|
|
|
|
|
|
|
FROM base AS builder
|
|
|
|
|
|
|
|
WORKDIR $GOPATH/src/fq
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
COPY Makefile main.go ./
|
|
|
|
COPY pkg pkg
|
|
|
|
COPY internal internal
|
2021-09-18 19:12:36 +03:00
|
|
|
COPY format format
|
2020-06-08 03:29:51 +03:00
|
|
|
RUN make test fq
|
|
|
|
RUN cp fq /fq
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=builder /fq /fq
|
|
|
|
RUN ["/fq", "--version"]
|
|
|
|
ENTRYPOINT ["/fq"]
|