WIP for compiling rpi2 images

This commit is contained in:
IamTheFij 2018-08-03 17:58:29 -07:00
parent e032fe6a66
commit 2cee9c8513
2 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,5 @@
FROM golang:1.10 AS builder
ARG repo_arch
FROM ${repo_arch}golang:1.10 AS builder
RUN go get -u github.com/golang/dep/cmd/dep
@ -9,7 +10,7 @@ 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 alpine:latest
FROM ${repo_arch}busybox:latest
WORKDIR /root/
COPY --from=builder /go/src/app/dsched .

View File

@ -39,6 +39,10 @@ dep-update:
docker-build:
docker build -t $(DOCKER_TAG) .
.PHONY: docker-build-arm
docker-build-arm:
docker build --build-arg repo_arch=arm32v7/ -t $(DOCKER_TAG)-arm32v7 .
.PHONY: docker-run
docker-run:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock --name $(DOCKER_TAG)-run $(DOCKER_TAG)