Giter Site home page Giter Site logo

Why use sudo? about docker-lnmp HOT 6 OPEN

micooz avatar micooz commented on June 30, 2024 1
Why use sudo?

from docker-lnmp.

Comments (6)

micooz avatar micooz commented on June 30, 2024

The docker daemon needs to do a lot of things which really require root rights.

Running containers (and applications) with Docker implies running the Docker daemon. This daemon currently requires root privileges, and you should therefore be aware of some important details.

see: https://docs.docker.com/engine/security/security/

from docker-lnmp.

1e0ng avatar 1e0ng commented on June 30, 2024

If you just use docker-compose up, do you get errors? In my environment, it just works. Yes, the docker daemon currently requires root privilege, but the docker-compose is kind of some clients of the docker daemon, it doesn't need root privilege.

from docker-lnmp.

micooz avatar micooz commented on June 30, 2024

Ubuntu 14.04.4 LTS

Run docker-compose up without sudo gets:

ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

docker-compose is a set of python scripts, create containers will call docker run actually.

What is your operating system?

from docker-lnmp.

1e0ng avatar 1e0ng commented on June 30, 2024

I'm using OS X. I don't think this is an issue OS dependently. Maybe your error is caused by this.

I know the docker-compose calls docker run, and I think both of them don't need root privilege. You can see the official guide, and in there they just use

$ docker-compose up

from docker-lnmp.

micooz avatar micooz commented on June 30, 2024

The examples in the README assume that your are in production, usually Linux, not OS X.

Are there any evidence to prove that the user is not root in the official guide?

I know docker containers can be created without sudo in OS X, but it depends on a VM. Maybe you should check out the user privileges of docker deamon in your VirtualBox.

from docker-lnmp.

1e0ng avatar 1e0ng commented on June 30, 2024

Yes, the $ sign is an evidence. Note the official guid use the $ sign, which means it's not a root user. If it's a # sign, it means a root user.

from docker-lnmp.

Related Issues (11)

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.