porter: Problem executing docker-compose mixin on windows

The bug

porter install --allow-docker-host-access fails (see log below)

Running docker desktop on windows. all my docker commands including compose run without any problem. Porter cannot bind to the docker_host.

Tentative solution

i have tried to set an evn variable DOCKER_HOST to point to the tcp socket but porter seems to ignore that variable completely. I have also tried to define it as a credential or param inside the bundle but it does not work.

Log

here the log:

Error: unable to instantiate driver: allow-docker-host-access was specified but could not detect a local docker daemon running by checking for /var/run/docker.sock

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

The snippet that I sent does not embed any sensitive values into the porter.yaml and instead uses environment variables. You can use that code, exactly the way it is without modification and credentials are securely injected by Porter when the bundle is run.

Maybe this documentation on how credentials are injected will help explain? https://porter.sh/credentials/

i have tried to bundle images inside the final CNAB bundle of my application, but i had some trouble of using those images inside the docker-compose file, since i could not use templating inside that file. Therefore i had to wire the image names and digests in the manifest files as custom env variables that then are going to be injected in the compose by the docker-compose mixin.

Thanks for bringing that up! Here an issue tracking the request to support swapping the images natively inside the mixin. https://github.com/getporter/docker-compose-mixin/issues/26

You can call docker login directly through the docker mixin without using exec

https://github.com/getporter/docker-mixin/#docker-login

- docker:
    login: # Login to docker registry using the DOCKER_USERNAME and DOCKER_PASSWORD environment variables