Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to run the example in readme #26

Closed
jakezhu9 opened this issue Nov 28, 2023 · 2 comments · Fixed by #27
Closed

Fail to run the example in readme #26

jakezhu9 opened this issue Nov 28, 2023 · 2 comments · Fixed by #27

Comments

@jakezhu9
Copy link

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker Image
uses: docker/build-push-action@v5
with:
repository: my-example-image
tags: latest
- uses: shrink/actions-docker-extract@v3
id: extract
with:
image: my-example-image
path: /app/.
- name: Upload Dist
uses: actions/upload-artifact@v3
with:
path: ${{ steps.extract.outputs.destination }}
name: dist

I try to run this example, but i got a warning in docker/build-push-action:

Warning: Unexpected input(s) 'repository', valid inputs are ['add-hosts', 'allow', 'annotations', 'attests', 'build-args', 'build-contexts', 'builder', 'cache-from', 'cache-to', 'cgroup-parent', 'context', 'file', 'labels', 'load', 'network', 'no-cache', 'no-cache-filters', 'outputs', 'platforms', 'provenance', 'pull', 'push', 'sbom', 'secrets', 'secret-envs', 'secret-files', 'shm-size', 'ssh', 'tags', 'target', 'ulimit', 'github-token']

and error in shrink/actions-docker-extract:

Unable to find image 'my-example-image:latest' locally
Error response from daemon: pull access denied for frontend, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
must specify at least one container source
Error: The process '/bin/bash' failed with exit code 1

I think it should be:

         uses: docker/build-push-action@v5 
         with: 
           tags: my-example-image:latest 
@shrink
Copy link
Owner

shrink commented Nov 28, 2023

I try to run this example, but i got a warning in docker/build-push-action:

Sorry about that! I made a mistake when upgrading the examples to the latest version of docker/build-push-action which is not backwards compatible with the previous version (v1):

repository Required Docker repository to tag the image with.
tags Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags.

If you change the example to...

       - name: Build Docker Image 
         uses: docker/build-push-action@v5 
         with: 
-          repository: my-example-image 
-          tags: latest 
+          tags: my-example-image:latest
+          push: true

That should work. I'll update the README.

...and error in shrink/actions-docker-extract:...

That error is because the previous step failed, once the previous step is working this should start working. If you encounter any further issues, let me know!

@shrink shrink linked a pull request Nov 28, 2023 that will close this issue
@shrink
Copy link
Owner

shrink commented Nov 28, 2023

@jakezhu9 the README example is fixed now, and I've added tests to confirm it works. Thank you for flagging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants