question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Where is the config.json?

See original GitHub issue

I’m a little confused about how this action’s side-effects are persisted. I expected to see a $HOME/.docker/config.json file but I’m not seeing it.

The problem I’m trying to solve is enabling experimental docker CLI features in a subsequent step after using docker/login-action. I’m trying:

DOCKER_CFG_PATH="${DOCKER_CONFIG:-$HOME/.docker}/config.json"
jq '. + {"experimental": "enabled"}' < "$DOCKER_CFG_PATH" | sponge "$DOCKER_CFG_PATH"

but $DOCKER_CFG_PATH doesn’t exist. When I try to create an empty config.json and set the experimental flag on that I lose my docker login session.

Any tips on enabling experimental docker CLI features after using this action? Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mgalgscommented, Nov 19, 2020

gaaah I just realized what my issue was, thanks to your comment.

I was trying to access ~/.docker/config.json from within my own custom action. So I was running in a docker container, not in the runner where docker/login-action does its work. That’s why I couldn’t see any ~/.docker/config.json being created. It was there on the runner, just not inside my container 🤦

To fix this, my docker login step is now two steps, and looks like this:

    - name: Login to DockerHub on runner
      uses: docker/login-action@v1
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_TOKEN }}
    - name: Login to DockerHub on workspace
      uses: docker://docker
      with:
        entrypoint: docker
        args: login --username="${{ secrets.DOCKERHUB_USERNAME }}" --password="${{ secrets.DOCKERHUB_TOKEN }}"

With that, I can build custom actions that use private image bases and interact with the registry from within my custom actions themselves.

I’ll submit a patch with a small note on the README in case it’s useful.

0reactions
crazy-maxcommented, Nov 22, 2020

@mgalgs Just tested pulling a private image in a container and in another step of the job and it works for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Different locations of config.json · Issue #2210 · homebridge ...
Hello where is the config.json supposed to be located? I have seen different tutorials placing it in different locations: ...
Read more >
Customizing the config.json file - IBM
Double-click the config.json file, or right-click the file and select Open with > PDK JSON Editor.
Read more >
config.json Description | Drupal.org
config.json is the main configuration file. Data from config.json is used to configure virtual machine. After editing file make sure that your JSON...
Read more >
Creating JSON Configuration Files for Your Deployments
yaml file is created in the [DIRECTORY_PATH] directory. Ensure that the ID of your version is defined in the app. json configuration file....
Read more >
Config.json quick question : r/homebridge - Reddit
NOTE: Your config.json file MUST be inside of .homebridge, which is inside of your home folder. On macOS and Linux, the full path...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found