Skip to content

Replace Docker Hub with Aliyun repositories #120

Replace Docker Hub with Aliyun repositories

Replace Docker Hub with Aliyun repositories #120

Workflow file for this run

name: Docker Image CI
on:
push:
paths:
- 'scripts/**'
- 'Dockerfile-for-github-action'
- 'requirements.txt'
- 'example.env'
- '.github/workflows/docker-image.yml'
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Log into docker hub registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
no-cache: true
file: Dockerfile-for-github-action
tags: arcw/sgcc_electricity:latest,arcw/sgcc_electricity:1.4.0
# run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
# - name: Build and push Docker image
# run: |
# PLATFORMS=linux/arm64,linux/amd64,linux/arm/v7
# DOCKER_IMAGE=arcw/sgcc_electricity
# docker buildx build --platform $PLATFORMS -t $DOCKER_IMAGE:latest -t $DOCKER_IMAGE:1.4.0 --file Dockerfile-for-github-action --push .
# - name: pull Docker image
# with:
# pull:mongo:4.4.18
# docker tag mongo:4.4.18 registry.cn-hangzhou.aliyuncs.com/arcw/mongo:4.4.18
# - name: Log into Aliyun hub registry and push Docker image
# run: |
# echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.ALIYUN_USERNAME }} --password-stdin registry.cn-hangzhou.aliyuncs.com
# PLATFORMS=linux/arm64,linux/amd64,linux/arm/v7
# DOCKER_IMAGE=registry.cn-hangzhou.aliyuncs.com/arcw/sgcc_electricity
# docker buildx build --platform $PLATFORMS -t $DOCKER_IMAGE:latest -t $DOCKER_IMAGE:1.4.0 --file Dockerfile-for-github-action --push .
# docker push registry.cn-hangzhou.aliyuncs.com/arcw/mongo:4.4.18