[Container-tools] Trick to do a docker "multi-stage-build" using minishift ?

Charles Moulliard cmoullia at redhat.com
Thu Jun 21 09:31:46 UTC 2018


Hi

Is there a trick to be able to do a multi stages build using docker 17.x
running in minishift [1] ?

E.g. Dockerfile to be processed

FROM golang:1.9.4 as builder
..
# Build and test the API code
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o controller-manager
./cmd/controller-manager/main.go
RUN go test ./pkg/... ./cmd/...

# Copy the controller-manager into a thin image
FROM ubuntu:latest
WORKDIR /root/
COPY --from=builder /go/src/
github.com/cmoulliard/my-controller/controller-manager .

Docker reports this error :

docker build . -f Dockerfile.controller -t
gcr.io/kubeships/controller-manager:v1
Sending build context to Docker daemon    246MB
Step 1/23 : FROM golang:1.9.4 as builder
Error parsing reference: "golang:1.9.4 as builder" is not a valid
repository/tag: invalid reference format

[1] https://docs.docker.com/develop/develop-images/multistage-build/

Regards

Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/container-tools/attachments/20180621/934d55a7/attachment.htm>


More information about the Container-tools mailing list