Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compose-Docker pull specific image:tag from a yml file service

I'm trying to build a docker flink containers using two different ways, through a Dockerfile and also with Docker compose. The Dockerfile works fine, but I'm facing some troubles with the Docker compose.

After a bit of reserach (if I've understood it correctly) when I execute a yml file, docker checks the services that are going to be use, and verifies that the needed images are pulled, If any of them is missing, docker starts the pull process. The problem is that by default, docker pulls the image:latest tag, and I'm interested in a specific tag.

I've tried to pull the image:tag before executing the docker-compose.yml file, but despite that, Docker compose ignores the already pulled image and starts downloading the image:latest tag

There is any mechanism to do that?

I don't know if it's useful for answer the question, but I attach the yml code I've:

version: "2.1"
services:
  jobmanager:
    image: ${FLINK_DOCKER_IMAGE_NAME:-flink}
    expose:
      - "6123"
    ports:
      - "8081:8081"
    command: jobmanager
    environment:
      - JOB_MANAGER_RPC_ADDRESS=jobmanager

  taskmanager:
    image: ${FLINK_DOCKER_IMAGE_NAME:-flink}
    expose:
      - "6121"
      - "6122"
    depends_on:
      - jobmanager
    command: taskmanager
    links:
      - "jobmanager:jobmanager"
    environment:
      - JOB_MANAGER_RPC_ADDRESS=jobmanager

Thank you

like image 864
Peter Rubi Avatar asked Jan 12 '18 11:01

Peter Rubi


1 Answers

Just specify explicitly the image and its tag that you want to use:

  jobmanager:
    image: <image-name>:<tag>
like image 171
yamenk Avatar answered Sep 27 '22 20:09

yamenk