Split Dockerfile
This commit is contained in:
parent
2cee9c8513
commit
af00d3baf2
@ -1,5 +1,4 @@
|
|||||||
ARG repo_arch
|
FROM golang:1.10 AS builder
|
||||||
FROM ${repo_arch}golang:1.10 AS builder
|
|
||||||
|
|
||||||
RUN go get -u github.com/golang/dep/cmd/dep
|
RUN go get -u github.com/golang/dep/cmd/dep
|
||||||
|
|
||||||
@ -10,7 +9,7 @@ RUN dep ensure --vendor-only
|
|||||||
COPY ./main.go /go/src/app/
|
COPY ./main.go /go/src/app/
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o dsched .
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o dsched .
|
||||||
|
|
||||||
FROM ${repo_arch}busybox:latest
|
FROM busybox:latest
|
||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
COPY --from=builder /go/src/app/dsched .
|
COPY --from=builder /go/src/app/dsched .
|
||||||
|
|
||||||
|
16
Dockerfile.arm32v7
Normal file
16
Dockerfile.arm32v7
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
FROM arm32v7/golang:1.10 AS builder
|
||||||
|
|
||||||
|
RUN go get -u github.com/golang/dep/cmd/dep
|
||||||
|
|
||||||
|
WORKDIR /go/src/app/
|
||||||
|
COPY ./Gopkg.* /go/src/app/
|
||||||
|
RUN dep ensure --vendor-only
|
||||||
|
|
||||||
|
COPY ./main.go /go/src/app/
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o dsched .
|
||||||
|
|
||||||
|
FROM arm32v7/busybox:latest
|
||||||
|
WORKDIR /root/
|
||||||
|
COPY --from=builder /go/src/app/dsched .
|
||||||
|
|
||||||
|
CMD [ "./dsched" ]
|
2
Makefile
2
Makefile
@ -41,7 +41,7 @@ docker-build:
|
|||||||
|
|
||||||
.PHONY: docker-build-arm
|
.PHONY: docker-build-arm
|
||||||
docker-build-arm:
|
docker-build-arm:
|
||||||
docker build --build-arg repo_arch=arm32v7/ -t $(DOCKER_TAG)-arm32v7 .
|
docker build -t $(DOCKER_TAG)-arm32v7 ./Dockerfile.arm32v7
|
||||||
|
|
||||||
.PHONY: docker-run
|
.PHONY: docker-run
|
||||||
docker-run:
|
docker-run:
|
||||||
|
Loading…
Reference in New Issue
Block a user