Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide docker images compatible with apple M1 #170

Open
vwiencek opened this issue Jun 13, 2021 · 1 comment
Open

Provide docker images compatible with apple M1 #170

vwiencek opened this issue Jun 13, 2021 · 1 comment

Comments

@vwiencek
Copy link

I guess docker automatically build image for linux/amd64 platform

Would that be possible to build images for arm platforms ?

I guess we should do it by adding some CI script to the current Dockerfile

Below is an example from my gitlab CI script for my projects

build-service:
  stage: deploy
  image: docker:dind
  variables:
      PLATFORMS: "linux/arm64,linux/amd64"
  script:
    - apt-get install -y curl jq
    - mkdir -p ~/.docker/cli-plugins/
    - BUILDX_LATEST_BIN_URI=$(curl -s -L https://github.com/docker/buildx/releases/latest | grep 'linux-amd64' | grep 'href' | sed 's/.*href="/https:\/\/github.com/g; s/amd64".*/amd64/g')
    - curl -s -L ${BUILDX_LATEST_BIN_URI} -o ~/.docker/cli-plugins/docker-buildx
    - chmod a+x ~/.docker/cli-plugins/docker-buildx
    - BINFMT_IMAGE_TAG=$(curl -s https://registry.hub.docker.com/v2/repositories/docker/binfmt/tags | jq '.results | sort_by(.last_updated)[-1].name' -r)
    - docker run --rm --privileged docker/binfmt:${BINFMT_IMAGE_TAG}
    - git clone https://github.com/my_repo.git
    - docker buildx create --name multibuilder 
    - docker buildx use multibuilder
    - docker buildx build --platform "${PLATFORMS}" --tag $IMAGE_TAG --build-arg ci_job_token=$CI_JOB_TOKEN  . --push
  only:
    - master

The purpose here is to choose platforms for which the image should be built.

Is that something feasible with current jhipster CI framework ?

@pascalgrimaud
Copy link
Member

The build of Docker image is done by Docker Hub. All we needed is a new Dockerfile, so I can try to param another Docker image, with specific tag for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants