fix build with using golang:latest

This commit is contained in:
Harduino
2021-02-25 13:58:38 +03:00
parent 1648a8921c
commit ee8b757c3b
3 changed files with 16 additions and 4 deletions
+8 -2
View File
@@ -1,4 +1,4 @@
from golang as builder
FROM golang:1.16.0-buster as builder
WORKDIR /app
@@ -9,7 +9,13 @@ RUN go get -u github.com/gorilla/mux
RUN go get -u github.com/patrickmn/go-cache
COPY worker.go /app/worker.go
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker .
RUN go env -w GO111MODULE=auto && \
go get github.com/docker/docker/api/types && \
go get github.com/docker/docker/api/types/container && \
go get github.com/docker/docker/client && \
go get github.com/gorilla/mux && \
go get github.com/patrickmn/go-cache && \
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker .
FROM alpine:3.12