容器技术

七十、Git和容器CI/CD-GitHub Actions实现b

2022-01-22  本文已影响0人  InsaneLoafer

搜索buildx的例子

Docker Setup Buildx · Actions · GitHub Marketplace

改进docker-build.yml文件

name: Docker image buildx and push
on: [push]
jobs:
  Docker-Build-Push:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        id: buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Login to DockerHub
        uses: docker/login-action@v1 
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_PASSWORD }}
      -
        name: Build and push
        id: docker_build
        uses: docker/build-push-action@v2
        with:
          push: true
          platforms: linux/amd64,linux/arm64
          tags: insaneloafer/flask-redis:latest

查看结果


上一篇下一篇

猜你喜欢

热点阅读