Skip to content

Commit

Permalink
Add support for RISC-V
Browse files Browse the repository at this point in the history
Signed-off-by: Antony Chazapis <[email protected]>
  • Loading branch information
chazapis committed Oct 23, 2024
1 parent 314fed6 commit 8a71d64
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
46 changes: 46 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,50 @@ volumes:
host:
path: /var/run/docker.sock

---
kind: pipeline
name: riscv64
type: docker

platform:
os: linux
arch: amd64

steps:
- name: build
image: rancher/dapper:v0.5.0
commands:
- dapper ci
volumes:
- name: docker
path: /var/run/docker.sock

- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/klipper-helm"
tag: "${DRONE_TAG}-riscv64"
username:
from_secret: docker_username
build_args:
- ARCH=riscv64
when:
instance:
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

volumes:
- name: docker
host:
path: /var/run/docker.sock

---
kind: pipeline
name: manifest
Expand All @@ -151,6 +195,7 @@ steps:
- linux/amd64
- linux/arm64
- linux/arm
- linux/riscv64
target: "rancher/klipper-helm:${DRONE_TAG}"
template: "rancher/klipper-helm:${DRONE_TAG}-ARCH"
when:
Expand All @@ -166,6 +211,7 @@ depends_on:
- amd64
- arm64
- arm
- riscv64

...

2 changes: 1 addition & 1 deletion Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH

RUN apk -U add bash docker-cli docker-cli-buildx git
ENV DAPPER_ENV REPO TAG DRONE_TAG
ENV DAPPER_ENV REPO TAG DRONE_TAG ARCH
ENV DAPPER_SOURCE /go/src/github.com/k3s-io/klipper-helm/
ENV DAPPER_OUTPUT ./bin ./dist
ENV DAPPER_DOCKER_SOCKET true
Expand Down
2 changes: 1 addition & 1 deletion package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN curl -sL https://get.helm.sh/helm-v3.16.1-linux-${ARCH}.tar.gz | tar xvzf -
COPY entry /usr/bin/

FROM golang:1.23-alpine3.20 as plugins
RUN apk add -U curl ca-certificates build-base binutils-gold
RUN apk add -U curl ca-certificates build-base
ARG ARCH
COPY --from=extract /usr/bin/helm /usr/bin/helm
RUN mkdir -p /go/src/github.com/k3s-io/helm-set-status && \
Expand Down
6 changes: 5 additions & 1 deletion scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ if [ -e ${DOCKERFILE}.${ARCH} ]; then
DOCKERFILE=${DOCKERFILE}.${ARCH}
fi

docker build --build-arg ARCH=${ARCH} --build-arg BUILDDATE=$(date +%Y%m%d) -f ${DOCKERFILE} -t ${IMAGE} .
if [ "$ARCH" = "riscv64" ]; then
export DOCKER_BUILDKIT=1
DOCKER_ARGS="--platform=$ARCH"
fi
docker build ${DOCKER_ARGS} --build-arg ARCH=${ARCH} --build-arg BUILDDATE=$(date +%Y%m%d) -f ${DOCKERFILE} -t ${IMAGE} .
echo Built ${IMAGE}

0 comments on commit 8a71d64

Please sign in to comment.