Giter VIP home page Giter VIP logo

Comments (5)

fujohnwang avatar fujohnwang commented on July 26, 2024 2

I make this work by setting server sudoers to be NOPASSWD, then when I run sudo , no password needed. After that I can PUT file to somewhere I can put it to then sudo mv it.

from efs2.

madflojo avatar madflojo commented on July 26, 2024

As long as it was password less sudo you could put sudo in RUN CMD sudo whoami but that doesn't apply to the file uploads.

I'll have to think of a good way to implement this. I believe the way Ansible for example solves this is if a privilege escalation tool is configured (i.e. sudo). They just wrap the commands with sudo in front (which you can do as shown above). But for file uploads I believe they upload the file into /tmp as a temporary file and then move it.

You could in theory accomplish the same thing with the below.

PUT daemon.json /var/tmp/daemon.json 0644
RUN CMD sudo mv /var/tmp/daemon.json /etc/docker/daemon.json

But I'll try to think of a good way to implement this within efs2. It would certainly end up being a "use privilege escalation tool" flag to enable it.

from efs2.

fujohnwang avatar fujohnwang commented on July 26, 2024

that's cool, man

I like efs2 so much.

If I would like to design such a tool, it should be like this: Simple API for users , just RUN and PUT is a good choice.

from efs2.

madflojo avatar madflojo commented on July 26, 2024

Awesome, thanks for that feedback!

from efs2.

madflojo avatar madflojo commented on July 26, 2024

After thinking about this some more this can all be done with a combination of PUT and RUN commands along with the use of sudo. Right now Efs2 isn't aware of the target OS type but to support this it would need to be which somewhat makes it more complex. I'm going to close this but won't say there isn't the possibility of doing something like this in the future.

from efs2.

Related Issues (12)

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.