Skip to content

Commit bc8ff9b

Browse files
committed
Build ARM image with Drone on Scaleway
1 parent cdf9b06 commit bc8ff9b

File tree

3 files changed

+66
-9
lines changed

3 files changed

+66
-9
lines changed

.drone.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
kind: pipeline
3+
name: linux-arm-docker
4+
5+
platform:
6+
os: linux
7+
arch: arm
8+
9+
- name: dryrun
10+
pull: always
11+
image: plugins/docker:linux-arm
12+
settings:
13+
dockerfile: Dockerfile.arm
14+
dry_run: true
15+
repo: stefanprodan/podinfo-arm
16+
tags: linux-arm
17+
username:
18+
from_secret: DOCKER_USERNAME
19+
password:
20+
from_secret: DOCKER_PASSWORD
21+
when:
22+
event:
23+
- push
24+
- pull_request

Dockerfile.arm

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM golang:1.11 as builder
2+
3+
RUN mkdir -p /go/src/github.com/stefanprodan/k8s-podinfo/
4+
5+
WORKDIR /go/src/github.com/stefanprodan/k8s-podinfo
6+
7+
COPY . .
8+
9+
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && CGO_ENABLED=0 GOOS=linux \
10+
go build -ldflags "-s -w -X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
11+
-a -installsuffix cgo -o podinfo ./cmd/podinfo
12+
13+
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && CGO_ENABLED=0 GOOS=linux \
14+
go build -ldflags "-s -w -X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
15+
-a -installsuffix cgo -o podcli ./cmd/podcli
16+
17+
FROM alpine:3.8
18+
19+
RUN addgroup -S app \
20+
&& adduser -S -g app app \
21+
&& apk --no-cache add \
22+
curl openssl netcat-openbsd
23+
24+
WORKDIR /home/app
25+
26+
COPY --from=builder /go/src/github.com/stefanprodan/k8s-podinfo/podinfo .
27+
COPY --from=builder /go/src/github.com/stefanprodan/k8s-podinfo/podcli /usr/local/bin/podcli
28+
COPY ./ui ./ui
29+
RUN chown -R app:app ./
30+
31+
USER app
32+
33+
CMD ["./podinfo"]

Dockerfile.ci

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ COPY . .
88

99
RUN go test $(go list ./... | grep -v integration | grep -v /vendor/ | grep -v /template/) -cover
1010

11-
RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*") && \
12-
GIT_COMMIT=$(git rev-list -1 HEAD) && \
13-
CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w \
14-
-X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
15-
-a -installsuffix cgo -o podinfo ./cmd/podinfo
16-
17-
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w \
18-
-X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
19-
-a -installsuffix cgo -o podcli ./cmd/podcli
11+
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && \
12+
CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w \
13+
-X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
14+
-a -installsuffix cgo -o podinfo ./cmd/podinfo
15+
16+
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && \
17+
CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w \
18+
-X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
19+
-a -installsuffix cgo -o podcli ./cmd/podcli
2020

2121
FROM alpine:3.8
2222

0 commit comments

Comments
 (0)