Use name for build stage

pull/2/head
Stefan Scherer 7 years ago
parent aaa30d3d2b
commit ca486f5694
No known key found for this signature in database
GPG Key ID: 5966AEAC37E957FA

@ -1,4 +1,4 @@
FROM golang
FROM golang AS build
COPY . /code
WORKDIR /code
@ -7,7 +7,7 @@ RUN CGO_ENABLED=0 go build -a -installsuffix cgo http.go
FROM scratch
COPY --from=0 /code/http /http
COPY --from=build /code/http /http
EXPOSE 8080

@ -1,4 +1,4 @@
FROM golang
FROM golang AS build
COPY . /code
WORKDIR /code
@ -7,7 +7,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -a -installsuffix cgo http.go
FROM scratch
COPY --from=0 /code/http /http
COPY --from=build /code/http /http
EXPOSE 8080

@ -1,4 +1,4 @@
FROM golang
FROM golang AS build
COPY . /code
WORKDIR /code
@ -7,7 +7,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -installsuffix cgo http.go
FROM scratch
COPY --from=0 /code/http /http
COPY --from=build /code/http /http
EXPOSE 8080

@ -1,4 +1,4 @@
FROM golang:nanoserver
FROM golang:nanoserver AS build
COPY . /code
WORKDIR /code
@ -7,7 +7,7 @@ RUN go build http.go
FROM microsoft/nanoserver
COPY --from=0 /code/http.exe /http.exe
COPY --from=build /code/http.exe /http.exe
EXPOSE 8080

Loading…
Cancel
Save