Giter Club home page Giter Club logo

docker-run-action's People

Contributors

addnab avatar heyman avatar kohlerdominik avatar mdpye avatar rlancer avatar rossettistone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-run-action's Issues

Passing args to ENTRYPOINT script

So I'd like to know is there is a way, to pass arguments to entrypoint script inside docker image?

My usecase.

I have my Dockerfile ending line this

...
ENTRYPOINT ["/bin/bash", "entrypoint.sh"]

entrypoint.sh - takes several arguments to make its work.

I've expected that somehow I could pass script's arguments as I would do in conventional docker container run

docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]
docker container run -v ... my_image:latest --script_args1=value1

But it seems it is impossible?

$GITHUB_ENV: ambiguous redirect

  -  name: Test
      uses: addnab/docker-run-action@v3
    
      with:
        image: alpine
        options: --rm -i -v ${{ github.workspace }}:/app -w=/app
        run: |
          echo "Start"
          echo "DEPLOY_STATE=successful" >> $GITHUB_ENV

gives ambiguous redirect exception, could workaround this by adding another trailing echo

Can't use with containerd

Run addnab/docker-run-action@v3
/home/ubuntu/bin/docker run --name d8b0ced24c48b43d178912d9831e_6122bb --label 765292 --workdir /github/workspace --rm -e "NAMESPACE" -e "ECR_REGISTRY" -e "REGION" -e "KUBECTL_VERSION" -e "ECR_REPOSITORY" -e "DOCKER_FILE" -e "ENVIRONMENT" -e "AWS_DEFAULT_REGION" -e "AWS_REGION" -e "INPUT_REGISTRY" -e "INPUT_IMAGE" -e "INPUT_OPTIONS" -e "INPUT_RUN" -e "INPUT_SHELL" -e "INPUT_USERNAME" -e "INPUT_PASSWORD" -e "INPUT_DOCKER_NETWORK" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/opt/actions-runner/_work/_temp/_github_home":"/github/home" -v "/opt/actions-runner/_work/_temp/_github_workflow":"/github/workflow" -v "/opt/actions-runner/_work/_temp/_runner_file_commands":"/github/file_commands" -v "/opt/actions-runner/_work/ExternalOrderAPI/ExternalOrderAPI":"/github/workspace" 765292:6236d8b0ced24c48b43d178912d9831e
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

I've tried to add the option -v and use the correct docker.sock

      - name: Run Migrations
        uses: addnab/docker-run-action@v3
        with:
          registry: ${{ env.ECR_REGISTRY }}
          image: ${{ env.ECR_REPOSITORY }}:${{github.sha}}
          options: -v /run/containerd/containerd.sock:/var/run/docker.sock
          run: |
            ls -la
            python manage_custom.py showmigrations 2>&1

But it isn't working
What I have in the instance

root@ip-10-20-2-26:~# ps aux | grep docker
ubuntu     10097  0.0  0.0 709352  7080 ?        Ssl  16:14   0:00 rootlesskit --net=vpnkit --mtu=1500 --slirp4netns-sandbox=auto --slirp4netns-seccomp=auto --disable-host-loopback --port-driver=builtin --copy-up=/etc --copy-up=/run --propagation=rslave /home/ubuntu/bin/dockerd-rootless.sh
ubuntu     10103  1.8  0.1 710248  9324 ?        Sl   16:14   0:54 /proc/self/exe --net=vpnkit --mtu=1500 --slirp4netns-sandbox=auto --slirp4netns-seccomp=auto --disable-host-loopback --port-driver=builtin --copy-up=/etc --copy-up=/run --propagation=rslave /home/ubuntu/bin/dockerd-rootless.sh
ubuntu     10129  0.6  0.7 1492896 61376 ?       Sl   16:14   0:18 dockerd
ubuntu     10144  0.1  0.4 1333968 38276 ?       Ssl  16:14   0:05 containerd --config /run/user/1000/docker/containerd/containerd.toml --log-level info
root       16687  0.0  0.9 1310044 79800 ?       Ssl  16:31   0:00 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
root       34753  0.0  0.0   8168   720 pts/0    S+   17:04   0:00 grep --color=auto docker

Trying to access Postgres service from docker image

I'm trying to connect to Postgres db from within my Docker image to run tests:

  test_backend:
    runs-on:
      group: ubuntu-large
    needs: build_backend

    # Service containers to run with `container-job`
    services:
      # Label used to access the service container
      postgres:
        # Docker Hub image
        image: postgres
        # Provide the password for postgres
        env:
          POSTGRES_PASSWORD: postgres
        # Set health checks to wait until postgres has started
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # Maps tcp port 5432 on service container to the host
          - 5432:5432

    steps:
    - name: Run tests in container
      uses: addnab/docker-run-action@v3
      with:
        image: backend-py:${{github.sha}}
        run: ./manage.py test --noinput
        options: --env-file .github/workflows/env.test

There is a script, that tries to connect to Postgres running as a service. However I can't figure out, how to set the correct network/host value. I've tried to set in env.test:

DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${INPUT_DOCKER_NETWORK}:5432/${POSTGRES_DB}

Which gives me error:

django.db.utils.OperationalError: could not translate host name "${input_docker_network}" to address: Name or service not known

How should I specify the host name to successfully connect to Postgres GitHub service?

caching the Docker image

Hi, thanks for your great work on this, very helpful!

I was wondering what would be the best strategy to cache the docker image used by this action...would it be something related with using the cache action https://github.com/actions/cache? but how should we use it in combination with your action?

I also checked this thread: https://stackoverflow.com/questions/66421411/how-to-run-cached-docker-image-in-github-action, which gives a glimpse but I suppose your action would need to be modified for this...

support background containers

Can this support running containers in the background so that later steps can contact services inside the container?

Failure to mount Github volumes to container

Thank you for the docker-run-action! It really cleans up an otherwise quite verbose docker run command in my workflow yml.

I spent some time exploring the missing volume mounts in the docker image spun up by docker-run-action. I eventually recognized that your README suggests the following:

Typical Use Case
...
options: -v ${{ github.workspace }}:/work -e ABC=123

But there was no explanation for why the option is there (work-around for missing ~nominal Container Github Mounts?). I'm not sure what the ABC=123 environment variable is for? For something as fundamental as github docker filesystem mounts - the use of option seems strange (they should just always be mounted, I would expect). So I had omitted this as I didn't anticipate needing atypical Github container filesystem mounts.

Below is the diagnostic debug from a GitHub action using docker-run-action. Do you know why your action is having to use the additional volume mount (to /work) and the below volume mounts aren't working? (I do see below: -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/magma/magma":"/github/workspace"). I am attempting to turn on docker log capture to see if it gives more detail on the failure of these volume mounts. But probably you know more on this front?

Ultimately, I would want my workflows to use nominal Github Container Mount locations - as supported by Github environment variables - and not bake in /work or other mount points that are unexpected.

2021-03-13T09:21:19.7242028Z ##[command]/usr/bin/docker run --name e4c4ba00c7819a48ec8a9074eb7b6dcdbb_20fe66 --label 5588e4 --workdir /github/workspace --rm -e INPUT_IMAGE -e INPUT_RUN -e INPUT_OPTIONS -e INPUT_SHELL -e INPUT_REGISTRY -e INPUT_USERNAME -e INPUT_PASSWORD -e INPUT_DOCKER_NETWORK -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_DEBUG -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/magma/magma":"/github/workspace" 5588e4:c4ba00c7819a48ec8a9074eb7b6dcdbb

Newline replacement with semicolon not always safe

Some scripts can't be directly converted by string replacement. A good example is a for loop:

for value in 1 2 3 4; do
  echo "$value"
done

This gets converted to for value in 1 2 3 4; do; echo "$value"; done, causing:

ash: syntax error: unexpected ";"

The extra ; after the do is the source of this particular error.

It seems that simply passing in the script unchanged works fine; what's the intent behind modifying the input run value instead of passing it in with the newlines intact?

How to specify volume mount?

How would I mount the local directory as a volume? I would like to run this command using the GH action, but I see no option to mount volumes.

docker run --rm -v "$(pwd):/app" slashmo/swiftformat

Warning: Docker network rm failed with exit code 1

We are using this project to run a docker based application and run some Playwright tests. However in the Github actions output we get a warning:

Screenshot 2024-02-07 at 4 23 36โ€ฏPM

The Stop containers step is having trouble removing the network because there are still active endpoints:

Remove container network: github_network_76a4828f83f84110a385d9754e08f963
/usr/bin/docker network rm github_network_76a4828f83f84110a385d9754e08f963
Error response from daemon: error while removing network: network github_network_76a4828f83f84110a385d9754e08f963 id a44ff73f421df75f86fcf75b909486794466c517f7cb6e149046593d5b5d4d47 has active endpoints
Warning: Docker network rm failed with exit code 1

Perhaps we need to stop the application in the workflow. Is there a way to do that?

Long running command do not produce standard output continuously

Hello,
first of all, I am not 100% sure if my problem is caused by docker-run-action or it is an inherent property of Github Actions (but I guess it is unlikely).

I have the following workflow: https://github.com/yaqwsx/jlcparts/blob/ghactions/.github/workflows/update_components.yaml

Everything works nice - all the short-running commands show their output in the log. However, when I execute line 59 (jlcparts getlibrary) that takes about 10-15 minutes to complete, no output is produced for the first 6 minutes of the runtime. Then the output appears, but nothing happens for the next few minutes. So the standard output is probably somewhere buffered and the buffer is flushed quite infrequently.

How can I prevent this behavior and force continuous flushing of the stdout?

Possible to run image from local tar?

I have a local image, build in another job, which is stored as an artifact in "docker" (tar.gz) format. Is is possible to run this image directly?

Running an image built in previous step doesn't work anymore

This part of the documentation does not work as expected anymore.

- uses: docker/build-push-action@v1
  with:
    repository: test-image
    push: false
- uses: addnab/docker-run-action@v3
  with:
    image: test-image:latest
    run: echo "hello world"

docker/build-push-action gives the below warning while running action.

Warning: Input 'repository' has been deprecated with message: v2 is now available through docker/build-push-action@v2

Specify --rm with `docker run` to avoid cleanup issues with Gitea actions

I've been using this action in a workflow with Gitea actions, running an image with a volume mounted from the act_runner container:

      - name: Build
        uses: https://github.com/addnab/docker-run-action@v3
        with:
          image: myimage:mytag
          options: --volumes-from=${{ env.JOB_CONTAINER_NAME }}
          run: |
            g++ --version

On workflow exit an error is reported about a volume still being in use:

Error: Error occurred running finally: Error occurred running finally: Error response from daemon: remove GITEA-ACTIONS-TASK-push_WORKFLOW-ci_JOB-build-linux: volume is in use - [9f2c5c514906a56896158eae977a2d74f2e6eab97d03c97a3efa30c974dd8e69] (original error: <nil>) (original error: <nil>)

The container started by the docker-run-action is still there in docker ps -a output.

Adding a step to the workflow which runs docker rm $(docker ps -l --format '{{.ID}}') cleans this up.

I'm wondering whether specifying the --rm option in this action's entrypoint.sh might clean this up more effectively.

docker-run-action doesn't HONOR login step happened before

Hi, if I use docker login step somethere before that action, docker-run-action fails if I omit user & password params

      - name: Login to ACR
        uses: docker/login-action@v1
        with:
          registry: ${{ secrets.registry }}
          username: ${{ secrets.login }}
          password: ${{ secrets.password }}
          
    - name: Run 
        uses: addnab/docker-run-action@v3
        with:
          registry: ${{ secrets.registry }}
          image: ${{ secrets.registry }}/image:${{ secrets.image_tag }}
          options: --rm -i -v ${{ github.workspace }}:/app
          run: echo "Hi"

docker: Error response from daemon: Head https://***/v2/mahimage/manifests/v0.0.1: unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.

docker-run-action doesn't honor ENTRYPOINT defined in Dockerfile

I have a docker file that has a rather complex ENTRYPOINT set up so that when invokes it runs the provided command inside a conda environment.

When I try to use the docker-run-action to test the container in a github-action, it fails but this is because it seems that the entrypoint is redefined in the invocation.

It would be nice if there was a way to avoid redefining the entry point for images that have been designed this way.

Cheers!

Cannot connect to the Docker daemon

Often I get the following error in GitHub Actions. Rerunning jobs would work sometimes but it's quite inconvenient.

Run addnab/docker-run-action@v3
  with:
    registry: docker.io
    image: xxxx/xxxx-xxxx:0.0.x
    options: xxxx
    run: xxxx

[...]
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Any fix/workaround to this?

FAILS on docker image containing forward slashes

Given the following with an image containing forward slashes:

    - name: Test
      uses: addnab/docker-run-action@v3
      with:
        image: /my/super/cool/image:latest
        run: |
          echo "HELLO WORLD" 

I get the following error:

invalid argument "echo \"HELLO WORLD\" " for "-c, --cpu-shares" flag: strconv.ParseInt: parsing "echo \"HELLO WORLD\" ": invalid syntax
See 'docker run --help'.

Problem passing github environment variables

Hi, I'm trying to pass some github predefined environment variables.
I've tried passing the variables as:

options: >-
  -e GITHUB_REF=${{ env.GITHUB_REF }}
  -e GITHUB_SERVER_URL=${{ env.GITHUB_SERVER_URL }}
  -e GITHUB_REPOSITORY=${{ env.GITHUB_REPOSITORY }}
  -e GITHUB_RUN_ID=${{ env.GITHUB_RUN_ID }}
  ...

but the variables are empty inside the container. Then tried

options: >-
  -e GITHUB_REF="${GITHUB_REF}"
  -e GITHUB_SERVER_URL="${GITHUB_SERVER_URL}"
  -e GITHUB_REPOSITORY="${GITHUB_REPOSITORY}"
  -e GITHUB_RUN_ID="${GITHUB_RUN_ID}"
  ...

but it just pass the text as-is without interpreting the variables. Then tried creating a heredoc in a previous step

- name: Export github environment variables
  run: |
    chmod +x export_env.sh
    export_env.sh

the contents of export_env.sh is

#!/bin/sh

cat << EOF > set_env.sh
#!/bin/sh

export GITHUB_REF="${GITHUB_REF}"
export GITHUB_SERVER_URL="${GITHUB_SERVER_URL}"
export GITHUB_REPOSITORY="${GITHUB_REPOSITORY}"
export GITHUB_RUN_ID="${GITHUB_RUN_ID}"
EOF

when importing set_env.sh in the container

source ./set_env.sh

the file set_env.sh doesn't exists inside the container.
Then, how I pass those variables to the container?

cant mount multiple volumes

Happened to find this action as we need to run some steps in container and some on host.

I am trying to mount multiple volumes but see only one is getting mounted i.e. -v ${{ github.workspace }}:/work, may I know what's reason and how to make it possible to mount more than one volumes on container.

- uses: addnab/docker-run-action@v3
      with:
        username: ${{ secrets.GH_USER }}
        password: ${{ secrets.GH_TOKEN }}
        registry: ghcr.io
        image: ghcr.io/orga/image:tag
        options: -v ${{ github.workspace }}:/work -v /cache_on_host:/cache_on_container -v /cache_2_on_host:/cache_2_on_container --workdir /work
        run: |
          ls -lash /work      # works
          echo -e "Listing files in /cache_on_container"
          ls -lash /cache_on_container       # doesnt work

          echo -e "Listing files in /cache_2_on_container"
          ls -lash /cache_2_on_container       # doesnt work

the docker run command as well doesnt list 2nd, 3rd volume mount options.

given usecase is not possible with this action or I am missing something? TIA.

Using $GITHUB_OUTPUT

It seems I cannot use the new way of setting the output using the echo... >> $GITHUB_OUTPUT

Is it something not, yet, supported or an issue elsewhere?

Retrieving artifacts from this action

Hi,

First thank you for the nice action, it worked where the container/uses approach failed.
But how would I best upload the result of doing work inside the container to either a next step or for the artifacts?

-Morten

How to pass or use variables which are external to a running container?

I have a problem with using some variables in a container, passing them doesnt work neither by gh actions syntax ${{ }}, neither by passing variables by option -e --env service_name=$service_name.

I saw there is passing GITHUB_ENV to a run

/usr/bin/docker run --name a33c10e4e8e7590d943f4971e1dfe677bc911_413b5e --label 8a33c1 --workdir /github/workspace --rm -e team -e build_number -e svc_name -e namespace -e GITHUB_PATH -e GITHUB_ENV -e

But then when container runs, there are echoes of this vars and I'm getting this:

Team: 
Build number: 
Service name: 
Namespace: 

Options passed with docker-run-action returns error whereas checkout action works as expected

I'm attempting to utilize the options for docker-run-action and am running into issues. The options I'm attempting to run are from code located in a local Git repository and are as follows:

 - name: Build firewall rule definitions 
        uses: addnab/docker-run-action@v3
        with:
          image: xxx.artifactory.xxx.com/xxx/xxx:latest
          shell: bash
         options: -v ${{ github.workspace }}:/tf_files -v ${{ github.workspace }}:/rules.json xxx.artifactory.xxx.com/xxx/xxx/xxx/xxx:latest

Output from GitHub Actions:

Run addnab/docker-run-action@v3
  with:
    image: xxx.artifactory.xxx.com/xxx/xxx/xxx/xxx:latest
    shell: bash
    options: -v /usr/local/bin/actions-runner/_work/lab-fwaas-pipeline-bu/lab-fwaas-pipeline-bu:/tf_files -v /usr/local/bin/actions-runner/_work/lab-fwaas-pipeline-bu/lab-fwaas-pipeline-bu:/rules.json xxx.artifactory.xxx.com/xxx/xxx:latest
/usr/bin/docker run --name da03db67bcc03cd34707929c38a4ff1080d5_2da1b3 --label 88da03 --workdir /github/workspace --rm -e INPUT_IMAGE -e INPUT_SHELL -e INPUT_OPTIONS -e INPUT_RUN -e INPUT_REGISTRY -e INPUT_USERNAME -e INPUT_PASSWORD -e INPUT_DOCKER_NETWORK -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/usr/local/bin/actions-runner/_work/_temp/_github_home":"/github/home" -v "/usr/local/bin/actions-runner/_work/_temp/_github_workflow":"/github/workflow" -v "/usr/local/bin/actions-runner/_work/_temp/_runner_file_commands":"/github/file_commands" -v "/usr/local/bin/actions-runner/_work/lab-fwaas-pipeline-bu/lab-fwaas-pipeline-bu":"/github/workspace" 88da03:db67bcc03cd34707929c38a4ff1080d5
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "--entrypoint=bash": executable file not found in $PATH: unknown.
time="2022-01-04T22:42:24Z" level=error msg="error waiting for container: context canceled"

Whereas execution from run command via actions/checkout@v2 works without issue:

- uses: actions/checkout@v2
(login to artifactory and pull here)
- name: Run image
        run:  docker run -u 0 -v ${PWD}/tf_files:/app/tf_files -v ${PWD}/rules.json:/app/rules.jsonxxx.artifactory.xxx.com/xxx/xxx/xxx/xxx:latest

Logs:

1s
Run docker run -u 0 -v ${PWD}/tf_files:/app/tf_files -v ${PWD}/rules.json:/app/rules.json xxx.artifactory.xxx.com/xxx/xxx/xxx/xxx:latest
  docker run -u 0 -v ${PWD}/tf_files:/app/tf_files -v ${PWD}/rules.json:/app/rules.json xxx.artifactory.xxx.com/xxx/xxx/xxx/xxx:latest
  shell: /usr/bin/bash -e {0}

Can't use with AWS ECR

It does not seem possible to use this action with an image on AWS ECR. There does not appear to be any way to authenticate to AWS ECR.

Mounting ${{ github.workspace }}

Hello,

I'm trying something like this:

      - name: Test 1
        run: whoami > ${{ github.workspace }}/whoami.txt
      - name: Test 2
        uses: https://github.com/addnab/docker-run-action@v3
        with:
          image: docker:latest
          options: -v ${{ github.workspace }}:/work
          run: ls -la /work && echo "Test" > /work/test.log && ls -la /work
      - name: Test 3
        run: |
          ls -la ${{ github.workspace }}
          cat ${{ github.workspace }}/test.log

But /work doesn't seem to contain anything that is in ${{ github.workspace }}

So I'm not understanding the first example in the README, where it gives the impression that mounting ${{ github.workspace }} would let us pass files in the workspace to be used in other steps.

When running the Test 2 step above, would it be possible to mount ${{ github.workspace }}, write to a file in it, and have access to that file in the following steps?

This would be a good workaround for #41

Thanks!

Add tests

This action is starting to be used by a lot of projects. It's high time we add some tests.

Error on mount volume workspace github

[test/build]   ๐Ÿณ  docker create image=act-addnab-docker-run-action-v1:latest entrypoint=[] cmd=[]
[test/build] Created container name=act-test-build-1 id=95c50e4e08b65cc9c23b58da0cb57d1f5baf504a7c987ecfa3dce4ee00b70a17 from image act-addnab-docker-run-action-v1:latest
[test/build] ENV ==> [INPUT_IMAGE=archlinux INPUT_OPTIONS=-v $GITHUB_WORKSPACE:/work INPUT_RUN=echo "Testing running"
ls -l /work
/github/home/test_aur.sh
 GITHUB_WORKFLOW=test ACT=true HOME=/github/home GITHUB_EVENT_PATH=/github/workflow/event.json GITHUB_REF=refs/heads/avelino/test INPUT_USERNAME= GITHUB_RUN_NUMBER=1 GITHUB_WORKSPACE=/github/workspace GITHUB_ACTOR=nektos/act GITHUB_TOKEN= GITHUB_ENV=/github/workflow/envs.txt CI=true GITHUB_EVENT_NAME=push GITHUB_ACTION=1 GITHUB_SHA=75a4828d23c567965f95f732153074773fdbbdca INPUT_REGISTRY= INPUT_PASSWORD= GITHUB_ACTIONS=true INPUT_SHELL=sh GITHUB_RUN_ID=1 GITHUB_REPOSITORY=avelino/aur RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[test/build]   ๐Ÿณ  docker run image=act-addnab-docker-run-action-v1:latest entrypoint=[] cmd=[]
[test/build] Starting container: 95c50e4e08b65cc9c23b58da0cb57d1f5baf504a7c987ecfa3dce4ee00b70a17
[test/build] Started container: 95c50e4e08b65cc9c23b58da0cb57d1f5baf504a7c987ecfa3dce4ee00b70a17
| docker: Error response from daemon: create $GITHUB_WORKSPACE: "$GITHUB_WORKSPACE" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
| See 'docker run --help'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.