Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

docker-compose not pulling images if the corresponding service has a build context section

I am having trouble getting docker-compose pull to actually pull everything in my docker-compose.yml file.

It looks something like this. . .

services:
  my_Service1:
    image1: path-to-image.com/this_image:v0
    build:
      context: ./dir1/nesteddir/yetanothernesteddir
  my_Service2:
    image1: path-to-image.com/that_image:v0
    build:
      context: ./dir2/nesteddir/yetanothernesteddir
  my_Service1:
    image1: path-to-image.com/my_image:v0
    build:
      context: ./dir3/nesteddir/yetanothernesteddir

Specifically though, I have noticed that it will only pull the images without the build context section. However, if it has a build: context: section, it skips it.

In one yml file in particular, I only have services with build contexts, and so when I run the command, it does nothing. No output at all.

I am sure that I am connected to the repo as well as I am able to docker pull from the routes just fine.

Thank you for any help.

EDIT: In case it matters, I am pulling from a private nexus repo.

question from:https://stackoverflow.com/questions/65944487/docker-compose-not-pulling-images-if-the-corresponding-service-has-a-build-conte

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

When you use build, image refers to the name of the image that it's going to be built.

Check https://docs.docker.com/compose/compose-file/compose-file-v3/#build


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...