Skip to content

Open Docker Building via URL #61

Open Docker Building via URL

Open Docker Building via URL #61

Workflow file for this run

name: Open Docker Building via URL
on:
workflow_dispatch:
inputs:
dockerfile_registry:
description: 'Docker Registry to Push'
required: true
default: 'registry.cn-hongkong.aliyuncs.com'
dockerfile_url:
description: 'Dockerfile URL'
required: true
default: 'https://gitlab.com/chenyaofo/dockerfiles/-/raw/main/torch/latest'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare Dockerfile
id: prepare-dockerfile
run: |
wget ${{ github.event.inputs.dockerfile_url }} -O Dockerfile
echo "docker_tag=$(head -n 1 Dockerfile | sed 's/#//g' | sed 's/ //g')" >> $GITHUB_OUTPUT
echo "Docker TAG:"
echo "Building for $(head -n 1 Dockerfile | sed 's/#//g' | sed 's/ //g')"
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ${{ github.event.inputs.dockerfile_registry }}
username: ${{secrets.DOCKER_USER}}
password: ${{secrets.DOCKER_PASS}}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.prepare-dockerfile.outputs.docker_tag }}