Giter Club home page Giter Club logo

docker-buildx-drone's Introduction

docker-buildx-drone

Docker Image Build Status License Project Status: Inactive โ€“ The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.

Buy Me A Coffee

Deprecated

Buildx now comes bundled with Docker Engine and this image is no longer needed.

https://docs.docker.com/buildx/working-with-buildx/

Motivation

My continuous integration and continuous delivery (CI/CD) platform of choice is Drone. What is particular about this platform is that every step of the pipeline is executed inside an isolated docker container.

Buildx is an experimental feature available on Docker 19.03+ which allows the user to build images for multiple architectures.

The purpose of this image is to provide the latest Docker as well as the latest Buildx binary pre-installed.

Description

This image is based on Docker latest image and includes the latest Buildx binary. The Buildx binary version can be changed at the Docker image build-time.

Currently, this Docker image only supports amd64.

Example

Here is an example of a pipeline for Drone CI.

---
kind : pipeline
type: docker
name: build and publish docker image

platform:
  os: linux
  arch: amd64

trigger:
  event: [ push, pull_request ]

steps:
  - name: publish
    image: gordonpn/docker-buildx-drone
    environment:
      DOCKER_TOKEN:
        from_secret: DOCKER_TOKEN
    volumes:
      - name: dockersock
        path: /var/run/docker.sock
    commands:
      - echo $DOCKER_TOKEN | docker login -u gordonpn --password-stdin
      - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
      - docker buildx rm builder || true
      - docker buildx create --name builder --driver docker-container --use
      - docker buildx inspect --bootstrap
      - cd /drone/src/project-one
      - docker buildx build -t yourUsername/yourRepo:yourTag --platform linux/amd64,linux/arm64 --push .
      - cd /drone/src/project-two
      - docker build -t yourUsername/yourRepo:yourTag .
      - docker push yourUsername/yourRepo:yourTag

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

Building image with a different Buildx version

cd $PROJECT_DIR
docker build --build-arg BUILDX_VERSION=v0.4.0 .

Authors

@gordonpn

License

MIT License

docker-buildx-drone's People

Contributors

gordonpn avatar

Stargazers

 avatar

Watchers

 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.