Coder Social home page Coder Social logo

Comments (3)

wrfly avatar wrfly commented on May 19, 2024

and should update the docker version and other dependencies' version
also use go mod to replace the glide

from container-web-tty.

wrfly avatar wrfly commented on May 19, 2024

Maybe I'll leave this issue OPEN as #31 (comment):

Since docker will not re-bind the files to the containers after it restarts, so if we mount the docker.sock to the container, we will lose the connection to the restarted docker daemon since the docker daemon recreated its socket file, the docker.sock inside the container is actually a deleted file(we cannot see it in the outside, but we can get it inside the container).

The obvious solution is to restart the container so that the docker will re-bind the socket file.

Another way to solve this is to mount the whole /var/run directory to the container since the directory won't be deleted, the container-web-tty can still connect to the new docker daemon.

docker run --rm -ti --name web-tty \
    -p 8080:8080 \
    -v /var/run/:/var/run/ \
    wrfly/container-web-tty

Maybe it's a bug of docker, and it's quite easy to reproduce. Just mount a file to a container and delete that file, and you can still get the contant inside the container. At mainwhile, any changes before delete the file can be seen inside the container since the file is the same, it has the same inode number. But after delete the file in the host, we lost control of this file, and the file can be and only be found in the container. We can use lsof -L1 | grep deleted to get all the deleted files (in the host but not the container) and when we tail -f the "deleted" file inside the container, we can see the process is reading a "deleted" file. And we can also get the contant from its file descriptor(just cat it).

from container-web-tty.

wrfly avatar wrfly commented on May 19, 2024

Also check this: moby/moby#38955

from container-web-tty.

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.