BackwardCompatibilityCheck icon indicating copy to clipboard operation
BackwardCompatibilityCheck copied to clipboard

Additional info for running Docker image with private repos

Open rieschl opened this issue 4 years ago • 4 comments

I use this tool with Docker to check our internal libraries if our devs don't add bc breaks. I run it manually on my local machine for larger PRs, not automatically in GH actions.

So I need to modify the command a little bit and maybe someone in the same situation can benefit from that:

docker run --rm -v ~/.composer/auth.json:/composer/auth.json:ro -v ~/.ssh:/root/.ssh:ro  -v `pwd`:/app nyholm/roave-bc-check

That mounts the auth.json for composer (private Satis) and SSH keys to the container. It didn't work initially and I had to dig into the image to realize that the composer path is not in /root/.composer (which is the default) but in /composer.

Maybe it can be added to the readme to point users with private packages to the right direction?

Thanks!

rieschl avatar Nov 24 '20 16:11 rieschl

Maybe it can be added to the readme to point users with private packages to the right direction?

I think this should be documented in the docker image: the tool itself assumes a fully functional app as mounted volume, unless it does some trickery that I'm unaware of?

If it started doing more than that (such as running composer install), it would probably be best to link the image docs, instead of expanding scope here.

Ocramius avatar Nov 24 '20 16:11 Ocramius

Right, putting it in the readme of the docker repo is a good idea 🙂 @Nyholm what do you think?

rieschl avatar Nov 24 '20 16:11 rieschl

Ah, I just checked something that I missed as an assumption: roave/backward-compatibility-check does indeed perform composer install in a temporary location (by design).

Therefore nothing to do with Dockerfile, but it is true that docker install must be working according to current user credentials, when using private packages.

Ocramius avatar Nov 24 '20 16:11 Ocramius

-v ~/.ssh:/root/.ssh:ro

Probably not something to be put in documentation as an example: using a deployment SSH key is preferable :-)

Ocramius avatar Nov 24 '20 16:11 Ocramius