Skip to content

Commit

Permalink
feat(docker): fix build and remove arm 32 bit (grafana#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
Duologic authored Aug 16, 2021
1 parent ce3e48e commit c12e4ab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 58 deletions.
2 changes: 0 additions & 2 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ local docker(arch) = pipeline('docker-' + arch) {
} + { depends_on: ['check'] } + constraints.onlyTags,

docker('amd64') { depends_on: ['check'] } + constraints.onlyTagOrMain,
docker('arm') { depends_on: ['check'] } + constraints.onlyTagOrMain,
docker('arm64') { depends_on: ['check'] } + constraints.onlyTagOrMain,

pipeline('manifest') {
Expand All @@ -103,7 +102,6 @@ local docker(arch) = pipeline('docker-' + arch) {
} + {
depends_on: [
'docker-amd64',
'docker-arm',
'docker-arm64',
],
} + constraints.onlyTagOrMain,
Expand Down
52 changes: 1 addition & 51 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,55 +134,6 @@ trigger:
depends_on:
- check

---
kind: pipeline
name: docker-arm

platform:
os: linux
arch: arm

steps:
- name: fetch-tags
image: golang:1.15
commands:
- git fetch origin --tags
volumes:
- name: gopath
path: /go

- name: static
image: golang:1.15
commands:
- make static
volumes:
- name: gopath
path: /go

- name: container
image: plugins/docker
settings:
auto_tag: true
auto_tag_suffix: arm
password:
from_secret: dockerhub_password
repo: grafana/tanka
username:
from_secret: dockerhub_username

volumes:
- name: gopath
temp: {}

trigger:
ref:
- refs/heads/main
- refs/heads/docker
- refs/tags/v*

depends_on:
- check

---
kind: pipeline
name: docker-arm64
Expand Down Expand Up @@ -264,7 +215,6 @@ trigger:

depends_on:
- docker-amd64
- docker-arm
- docker-arm64

---
Expand Down Expand Up @@ -293,6 +243,6 @@ get:

---
kind: signature
hmac: 72469494de5902df2a0a375f1a38f1b064dcc2c3639d4978b86392f2b7c46f46
hmac: c3ef3feca15523713fdd108f6d6708488514efb9958707b812db888b799b2244

...
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# download kubectl
FROM golang:alpine3.14 as kubectl
FROM golang:alpine3.13 as kubectl
RUN apk add --no-cache curl
RUN export VERSION=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) &&\
export OS=$(go env GOOS) && \
Expand All @@ -8,15 +8,16 @@ RUN export VERSION=$(curl -s https://storage.googleapis.com/kubernetes-release/r
chmod +x /usr/local/bin/kubectl

# build jsonnet-bundler
FROM golang:alpine3.14 as jb
FROM golang:alpine3.13 as jb
WORKDIR /tmp
RUN apk add --no-cache git make bash &&\
git clone https://github.com/jsonnet-bundler/jsonnet-bundler &&\
ls /bin &&\
cd jsonnet-bundler &&\
make static &&\
mv _output/jb /usr/local/bin/jb

FROM golang:alpine3.14 as helm
FROM golang:alpine3.13 as helm
WORKDIR /tmp/helm
RUN apk add --no-cache jq curl
RUN export TAG=$(curl --silent "https://api.github.com/repos/helm/helm/releases/latest" | jq -r .tag_name) &&\
Expand All @@ -25,7 +26,7 @@ RUN export TAG=$(curl --silent "https://api.github.com/repos/helm/helm/releases/
curl -SL "https://get.helm.sh/helm-${TAG}-${OS}-${ARCH}.tar.gz" > helm.tgz && \
tar -xvf helm.tgz --strip-components=1

FROM golang:alpine3.14 as kustomize
FROM golang:alpine3.13 as kustomize
WORKDIR /tmp/kustomize
RUN apk add --no-cache jq curl
RUN export TAG=$(curl --silent "https://api.github.com/repos/kubernetes-sigs/kustomize/releases/latest" | jq -r .tag_name) &&\
Expand All @@ -37,7 +38,7 @@ RUN export TAG=$(curl --silent "https://api.github.com/repos/kubernetes-sigs/kus
tar -xvf kustomize.tgz

# assemble final container
FROM alpine:3.14
FROM alpine:3.13
RUN apk add --no-cache coreutils diffutils less git openssh-client
COPY tk /usr/local/bin/tk
COPY --from=kubectl /usr/local/bin/kubectl /usr/local/bin/kubectl
Expand Down

0 comments on commit c12e4ab

Please sign in to comment.