Giter Club home page Giter Club logo

docker-with-buildx's Introduction

Docker image with buildx (amd64,arm64) installed - weekly updated

A DIND (Docker in Docker) image with buildx to build multi platform docker images.

Documentation: https://github.com/SnickCH/docker-with-buildx

Key features

  • Weekly updates for the latest version of buildx: I try to use the newest version of buildx for the "latest" tag https://github.com/docker/buildx/releases/
  • Different versions are available if you need older ones
  • I will add examples on how to get startet with Git Lab
  • amd64 (tested) and arm64 (not tested)

Docker image and tags

Please check the docker hub site of the project for the tags if you need older versions

https://hub.docker.com/r/snickch/buildx/tags

docker pull snickch/buildx:latest

Gitlab runner requirements

You can use this in your gitlab pipeline on a gitlab runner or locally. If you use a gitlab runner make sure that you have the privileged flag enabled in your config.toml file (/etc/gitlab-runner/config.toml)

 [runners.docker]
 ...
    privileged = true
 ...
 
 

Gitlab Examples

In this examples, the variables are set on a project base. Make sure you set the variables that it works for your setup

File: .gitlab-ci.yml

image: snickch/buildx:latest

variables:
  DOCKER_DRIVER: overlay2
  DOCKER_TLS_CERTDIR: ""

services:
- name: docker:dind
  alias: thedockerhost

build:
  stage: build

  script:
    - docker version
    - docker login -u $dhub_user -p $dhub_password
    - docker buildx create --use
    - docker buildx build --push --platform linux/arm64,linux/amd64,linux/arm/v7,linux/arm/v6 --tag $CI_REGISTRY:$CI_COMMIT_REF_NAME .

File: Dockerfile

ARG ARCH=
FROM ${ARCH}debian:stable
# Install your packages you need
RUN apt-get update && apt-get install -y ....

The packages you want to install must be available for your plattform that you want to build for (example: arm, amd64 etc.)

##Testing the version of buildx If you want to test or troubleshoot if buildx is running in the image, you can do this manually on any docker instance with the following command (replace latest with the version, if you want to test an older one)

 docker run --rm -it  --name bx --privileged snickch/buildx:latest buildx version

docker-with-buildx's People

Contributors

jdrouet avatar snickch avatar

Stargazers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.