Comments (2)
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.
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)
- Docker Compose 'build args' incompatible with mapping notation HOT 4
- Add smoke test against Dependabot integration
- Incorrect text for CLI help output for terminal rows and columns HOT 1
- devcontainer templates apply support path to local templates HOT 1
- Support : in the default value of substitutions
- Support add extra options to `docker build` command. HOT 3
- Dev container configuration in user storage that builds from docker file does not use local folder path HOT 2
- devcontainer template publish does not support gcp artifact registry HOT 1
- Syntax directive failing behind corporate docker mirror (e.g. artifactory)
- Syntax directive failing behind corporate docker mirror (e.g. artifactory) HOT 2
- Devcontainer fails in open in windows but not on mac HOT 3
- Testing features not possible on Windows HOT 3
- Error on devcontainer open on MacOS // vscode HOT 1
- Error ENOENT occurs with compose file containing `dockerfile_inline` field. HOT 1
- devcontainer process exited with exit code 1 followed by compressed JavaScript gibberish is not very help to understand problem HOT 2
- Behind a proxy: "Error getting blob: Error: connect ETIMEDOUT 185.199.108.154:443" HOT 3
- Secrets for containerEnv HOT 2
- Unable to build a devcontainer features with podman HOT 3
- Feature: Add a "force" flag to feature push to override an existing version HOT 1
- Failed to load user settings HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.