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

Entrypoint path is not correct when running docker in docker #24

Closed
dragosMC91 opened this issue Jul 17, 2023 · 2 comments
Closed

Entrypoint path is not correct when running docker in docker #24

dragosMC91 opened this issue Jul 17, 2023 · 2 comments

Comments

@dragosMC91
Copy link

I might be misunderstanding this but I have to following situation:

I am running docker in docker.
When the container is started, the following mapping is being done: /runner/_work/_actions/ (host) -> /__w/_actions (work container)
When I try to install the aws cli via this action I then get

sudo: /runner/_work/_actions/unfor19/install-aws-cli-action/v1.0.3/entrypoint.sh: command not found
Error: Process completed with exit code 1.

My question is, why is the script executed from the GITHUB_ACTION_PATH folder (https://github.com/unfor19/install-aws-cli-action/blob/master/action.yml#L49) and not from ROOTDIR ?

Thanks in advance!

(I tried to override GITHUB_ACTION_PATH but it looks like gh doesn't allow this)

@unfor19
Copy link
Owner

unfor19 commented Jul 18, 2023

Hi @dragosMC91 , the variable GITHUB_ACTION_PATH replaced github.action_path, see #23

I'm unsure how to replicate your actions, but as an alternative, you can add a step in your pipeline, as mentioned in the README.md, so instead of using this action as a classic action, in your complex use-case of docker-in-docker, you might be able to use-

steps:
# Your steps ...
      - name: Install AWS CLI
        shell: bash
        run: |
           curl -L -o install-aws.sh https://raw.githubusercontent.com/unfor19/install-aws-cli-action/master/entrypoint.sh && \
           sudo chmod +x install-aws.sh && \
           sudo ./install-aws.sh "v2" "amd64" && \
           sudo rm install-aws.sh

Is that good enough?

@dragosMC91
Copy link
Author

Hello @unfor19 , thanks for taking the time to reply.

I read the docs and eventually implemented what you suggested above and everything works fine.

I just thought
run: sudo --preserve-env ${GITHUB_ACTION_PATH}/entrypoint.sh was supposed to be run: sudo --preserve-env ${ROOTDIR}/entrypoint.sh after reading the code initially and wanted to signal a potential issue. But if this is the intended way of doing it, issue can be closed

@unfor19 unfor19 closed this as completed Jul 18, 2023
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

No branches or pull requests

2 participants