Closed dylode closed 4 weeks ago
As you run docker compose -f third_party/netbox-docker/docker-compose.yml ...
the project directory is set to the parent folder of this first compose file (third_party/netbox-docker
) and so relative paths are resolved based on it
You can confirm using docker compose config
:
$ docker compose -f third_party/netbox-docker/docker-compose.yml -f docker-compose.yml -p netbox-deployer config
name: netbox-deployer
services:
app:
build:
context: /Users/nicolas/truc/netbox-deployer/third_party/netbox-docker
dockerfile: Dockerfile
...
To keep project directory relative to your current working directory, pass your local compose file first:
$ docker compose -f docker-compose.yml -f third_party/netbox-docker/docker-compose.yml <command>`
Still, file in the second file will then fail to resolve relative paths. Your use case is a typical example to use include so you can rely on third-party compose file
@ndeloof Thanks. So I was actually loading the Docker file from netbox-docker. Got it. I was trying to merge Compose files (add my network to the netbox container), this doesn't seem to work anymore with include.
https://docs.docker.com/compose/multiple-compose-files/merge/
Unfortunately I did miss the warning, so what I tried to achieve might not be possible.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Description
When merging two Compose files I cannot build my own image and I get "failed to solve: base name (${FROM}) should not be blank" I have not found a solution yet other than to remove the netbox-docker compose file.
Not working:
Command:
docker-compose.yml:
Working:
Command:
docker-compose.yml:
I would expect that merging Compose files would not brake building my
app
image.Steps To Reproduce
No response
Compose Version
Docker Environment
Anything else?
My project, if that helps: https://github.com/dylode/netbox-deployer