Made changes to CI/CD for buildx build.
This commit is contained in:
parent
30c93de13e
commit
b52a231c3c
1 changed files with 25 additions and 11 deletions
32
.drone.yml
32
.drone.yml
|
|
@ -3,22 +3,36 @@ kind: pipeline
|
|||
type: docker
|
||||
name: default
|
||||
|
||||
environment:
|
||||
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||
|
||||
services:
|
||||
- name: dind
|
||||
image: docker:dind
|
||||
privileged: true
|
||||
command: ["dockerd", "--experimental"]
|
||||
volumes:
|
||||
- name: docker_socket
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
volumes:
|
||||
- name: docker_socket
|
||||
temp: {}
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: alexviscreanu/buildx
|
||||
image: docker:latest
|
||||
commands:
|
||||
- docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
|
||||
- export BUILDER_ID="crosscomp-$(cat /proc/self/cgroup | head -1 | cut -d '/' -f 3)"
|
||||
- docker buildx create --use --name $BUILDER_ID --driver-opt image=stargate01/buildkit
|
||||
- docker buildx inspect --bootstrap
|
||||
- echo $REGISTRY_PASS | docker login --username $REGISTRY_USER --password-stdin $REGISTRY_HOST
|
||||
- docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --output=type=image,push=true --progress tty --build-arg TAG=$DRONE_TAG -t $REGISTRY_HOST/$IMAGE:$DRONE_TAG -t $REGISTRY_HOST/$IMAGE:latest .
|
||||
- docker buildx rm $BUILDER_ID
|
||||
- case $(uname -a) in *x86_64*) export ARCH="amd64" ;; *) export ARCH="unknown" ;; esac
|
||||
- export BUILDX_URL=$(wget -q -O - https://api.github.com/repos/docker/buildx/releases/latest | grep "browser_download_url.*linux-${ARCH}" | cut -d: -f2,3 | tr -d \")
|
||||
- mkdir -p ~/.docker/cli-plugins
|
||||
- wget -o ~/.docker/cli-plugins/docker-buildx "${BUILDX_URL}"
|
||||
- chmod a+x ~/.docker/cli-plugins/docker-buildx
|
||||
- docker version
|
||||
- docker buildx version
|
||||
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
- docker buildx create --name multiarch --use
|
||||
- docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 --output=type=image,push=true --progress tty --build-arg TAG=$DRONE_TAG -t $REGISTRY_HOST/$IMAGE:$DRONE_TAG -t $REGISTRY_HOST/$IMAGE:latest .
|
||||
volumes:
|
||||
- name: docker_socket
|
||||
path: /var/run/docker.sock
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue