Docker-compose allows you to utilize either preëxisting docker images or build from source. For the build option, the official reference requires
Either a path to a directory containing a Dockerfile, or a url to a git repository.
I'd like to take advantage of the latter case, so that I don't have to create a git submodule in my project, or register a new repository on Docker Hub. Unfortunately, there are no examples for how to format the url, and every form I've tried is mistaken for a relative file path.
e.g.
--- letsencrypt: build: https://github.com/letsencrypt/letsencrypt.git ...
Fails with the error:
ERROR: build path /{MY_CURRENT_PATH}/https:/github.com/letsencrypt/letsencrypt.git either does not exist or is not accessible.
I didn't have any more luck with the other forms I've tried:
From your project directory, start up your application by running docker compose up . Compose pulls a Redis image, builds an image for your code, and starts the services you defined. In this case, the code is statically copied into the image at build time.
Are you running version 1.5.2? It looks like this was actually recently added in https://github.com/docker/compose/pull/2430. Try upgrading.
Example:
--- version: '2' services: redis: image: "redis:3.2.3" hostname: redis redis-commander: build: https://github.com/joeferner/redis-commander.git command: --redis-host redis links: - "redis:redis" ports: - 8081
Tested with:
$ docker-compose -v docker-compose version 1.11.2, build dfed245
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With