Code Monkey home page Code Monkey logo

Comments (6)

xihan88 avatar xihan88 commented on September 13, 2024 1

@lucacome This issue is due to the problem from L331-L347 in this file

c, err = s.recreateIfNeeded(ctx, c, options.NoRecreate, options.ForceRecreate)
because if a container is not recreated, it shouldn't be connecting to the previous network and starting again. I will make a simple fix for it.
@vito-c In the previous version before my PR, a service will always be recreated (because of hashing an array of addresses) hence this issue won't show itself. I'm glad it brings out this important bug.

from libcompose.

lucacome avatar lucacome commented on September 13, 2024

I'm guessing it's because of this set to true: https://github.com/docker/libcompose/blob/master/docker/service/service.go#L242

from libcompose.

vito-c avatar vito-c commented on September 13, 2024

I can confirm this was introduced by this commit:
f5c34b0

from libcompose.

vito-c avatar vito-c commented on September 13, 2024

@xihan88

from libcompose.

vito-c avatar vito-c commented on September 13, 2024

Simple Expected Example with docker compose:

---
version: '2'
services:
    test.svr:
        container_name: test.svr
        image: alpine:latest
        command: sleep 10000
$ docker-compose up -d
Creating network "foo_default" with the default driver
Creating test.svr ...
Creating test.svr ... done
$ docker-compose up -d
test.svr is up-to-date

Then make a change to the compose file ports ["8080:8080"] for example

$ docker-compose up -d
Recreating test.svr ...
Recreating test.svr ... done

Libcompose is no longer following this behavior it is now barfing out an error on second up.

from libcompose.

lucacome avatar lucacome commented on September 13, 2024

Is anything happening about this?

from libcompose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.