I have a docker-compose.yml
file, which defines a services and its image.
service:
image: my_image
now, that I run docker-compose up
I get the following message:
$ docker-compose up
Pulling service (my_image:latest)...
Pulling repository docker.io/library/my_image
ERROR: Error: image library/my_image:latest not found
It is correct, that my_image
in this case is not on the docker hub. But I've created it with docker build -t my_image .
(in a different file) before and it is listed in docker images
.
Is there anything I miss to tell docker-compose, to not look for the image in the docker.io registry/hub?
[edit] docker client and server version is 1.9.1
, docker-compose version is 1.5.2
.
I'm running docker-compose (as well as docker) through the HTTP-API on a remote machine, don't know if this makes any difference.
The docker-compose pull command above pulls the latest versions of the images and then the docker-compose up -d command re-creates the containers from that images and starts them in a background.
Stops containers and removes containers, networks, volumes, and images created by up .
You can still find Docker Compose V1 in the `master` branch. Compose V1 is marked as deprecated, and we'll begin patching only high-severity vulnerabilities or fixing critical bugs until the next milestone. Developers can continue to alias docker-compose to use docker compose.
If you have image local or anywhere except docker hub you need to use build and path or url to Dockerfile. So basically when we work OFF dockerhub we change image to path !
ubuntu:
container_name: ubuntu
build: /compose/build/ubuntu
links:
- db:mysql
ports:
- 80:80
In this example am using my own Ubuntu Dockerfile that is places in the build path. The file should be named Dockerfile like normal and you just specify the path to folder where it is.
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