Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker-compose tries to pull already existing images

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.

like image 368
white_gecko Avatar asked Jan 30 '16 21:01

white_gecko


People also ask

Does docker compose pull new image?

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.

Does docker compose down remove images?

Stops containers and removes containers, networks, volumes, and images created by up .

Is docker compose deprecated?

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.


1 Answers

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.

like image 51
Mathias Asberg Avatar answered Oct 11 '22 02:10

Mathias Asberg