Giter Club home page Giter Club logo

Comments (2)

Chuxel avatar Chuxel commented on July 20, 2024

One thought here - why don't we simply chain an entrypoint script into the actual ENTRYPOINT for the container image as a part of the image build for the feature step? We can get the existing entrypoint (via docker inspect) and invoke it afterwards as an arg set. (Using exec "$@"). That also removes the need to reference the feature to get the entrypoint to apply... and it would automatically use whatever the container user was.

This was partly my rational for entrypoint.d in devcontainers/spec#19.

from cli.

chrmarti avatar chrmarti commented on July 20, 2024

The difficulty is with us temporarily setting USER root for the feature install scripts and then having to go back to USER <previous>. When features were built in a separate image (FROM <user image>), we did inspect the user image and pass its user as a build argument. Now that we build the user image and add the features in a single Dockerfile (for caching checksums and multi-arch builds), I haven't yet found a way to determine the user before we change it to root and then go back to it with USER.

E.g., if ENV would support command substitution (which it doesn't):

# Here: user's Dockerfile content
ENV PREVIOUS_USER=$(id -u -n)
# Here: features installation
USER ${PREVIOUS_USER}

The current fix covers a few cases by looking at the Dockerfile (which is hard to cover all cases including variables and multiple stages).

from cli.

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.