I am trying to create a simple docker action but instead of using the local Dockerfile in the repository I want to use a public on dockehub. I have created two repositories:
- docker-creator: which has the docker action
- docker-user: which is a job that uses docker-creator
This is my action.yml in docker-creator:
name: 'Hello World'
description: 'Greet someone and record the time'
inputs:
who-to-greet: # id of input
description: 'Who to greet'
required: true
default: 'World'
outputs:
time: # id of output
description: 'The time we greeted you'
runs:
using: 'docker'
image: 'docker://alpine:3.10'
args:
- ${{ inputs.who-to-greet }}
In the image param typically you will see 'Dockerfile' but in my example you see I have replaced it with a public docker registry container.
When I use docker-creator from docker-user I get this errordocker-creator error
This is the main.yml workflow in docker-user:
hello_world_job:
runs-on: ubuntu-latest
name: A job to say hello
steps:
- name: Hello world action step
id: hello
uses: bryanaexp/docker-creator@main
with:
who-to-greet: 'Cat'
# Use the output from the `hello` step
- name: Get the output time
run: echo "The time was ${{ steps.hello.outputs.time }}"
I have tried looking for help online but alot of it is only using dockerfile. Also I have referred to this documentation https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-using-public-docker-registry-container but no use.
LINKS: Docker Action : https://github.com/bryanaexp/docker-creator/blob/main/action.yml Github Action Using Docker Action: https://github.com/bryanaexp/docker-user
These are the following steps I have taken to resolve my problem: 1 - I have read through a lot of github action documentation
- https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-using-public-docker-registry-container 2 - Done various tests on my code using different parameters 3 - Researched stackoverflow but only found a similar example but that uses a private docker registry.