Skip to content

Instantly share code, notes, and snippets.

@thedewpoint
Created December 16, 2021 01:19
Show Gist options
  • Save thedewpoint/45018f6ed629e7b90f9cc9da64bf4a74 to your computer and use it in GitHub Desktop.
Save thedewpoint/45018f6ed629e7b90f9cc9da64bf4a74 to your computer and use it in GitHub Desktop.
gitlabs ci config for nodejs arm
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ECR: "<ecr-account>.dkr.ecr.us-east-1.amazonaws.com/<repo-name>:<tag>"
DOCKER_REGISTRY: "<ecr-account>.dkr.ecr.us-east-1.amazonaws.com"
DOCKER_HOST: "tcp://docker:2375"
stages:
- buildx
- publish
buildx:
image: docker:git
stage: buildx
variables:
GIT_STRATEGY: none
artifacts:
paths:
- buildx
expire_in: 1 hour
services:
- docker:dind
script:
- export DOCKER_BUILDKIT=1
- git clone git://github.com/docker/buildx ./docker-buildx
- docker build --platform=local -o . ./docker-buildx
publish:
image:
name: amazon/aws-cli
entrypoint: [""]
stage: publish
services:
- name: docker:dind
command: ["--experimental"]
before_script:
- amazon-linux-extras install docker
- mkdir -p ~/.docker/cli-plugins
- mv buildx ~/.docker/cli-plugins/docker-buildx
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
script:
- aws ecr get-login-password | docker login --username AWS --password-stdin $DOCKER_REGISTRY
- docker buildx create --use
- docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 --push -t $AWS_ECR .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment