Docker Community Forums

Share and learn in the Docker community.

Docker compose command

Hello all,

I am new to docker.
I want to run project by keeping all downloaded libraries to avoid any error when any library is not available anymore.

I though the comment is docker-compose up --no-recreate, however, i pull the code and see the code is updated, but when viewing on the web, it processes with the old code.

what is the right command to run a project by keeping the unupdated library and update what havs been updated?

best regards,

This pretty much prevents docker-compose to create a new container even if configuration changes, such as the image tag or anything else, have been applied.

The default behavior of docker-compose is to use existing images from the local image cache. If they don’t exist, they will be pulled. As long as you don’t delete an existing image from the local image cache (docker rmi ${image id} or docker image rm ${image id}) docker-compose will use the existing image.

Thus said, what do you mean by pull the code, see the code is updated, it processes with the old code and what is the right command to run a project by keeping the unupdated library and update what havs been updated?

Please help us to help you.

Dear Meyay,

Thanks for your quick reply.
Here is the case (let me try to explain from what my developer told me):

  1. We have file to configure our library
  2. After the first project build, docker-compose up --build, i see the libraries are retrieved and stored in local project folder
  3. We continue with coding
  4. Now we need to run project and since sometime we have new library, we run this docker-compose up --build or docker-compose up. I am not sure it is something related to library file configuration or docker command. After running this, docker-compose up --build, it seems go to remove existing image library file and try to retrieve again the library from internet and when the library is not available anymore on the cloud. we receive error when actually those libaries are already retrieved and stored in local.

Any feedbacks?

This implies that the service in the docker-compose.yml have a build block, which results in creating new images for those services. So the Dockerfile used to build the image, is the one responsible to retrieve the libraries and embed them in the image that is build. When a new image is build, the tag will point to the new created image and the image it pointed to before will be untagged (as in tag=<none>), but won’t be deleted.

WIth the level of vague details, Its hard to assume where things go wrong.

You might want to share the docker-compose.yml and the involved Dockerfiles to actualy allow us to understand what is going on.

Also, may I suggest to take this free fabulous online self paced docker training: Introduction to Containers.