Comments (6)
I think it is already done. When I try to run envbuilder inside a container from an integration test, it works and it looks like the binary is already in the image.
execContainer(t, ctr, "/.envbuilder/bin/envbuilder --help")
USAGE:
envbuilder
OPTIONS:
--base-image-cache-dir string, $ENVBUILDER_BASE_IMAGE_CACHE_DIR
The path to a directory where the base image can be found. This should
be a read-only directory solely mounted for the purpose of caching the
base image.
--build-context-path string, $ENVBUILDER_BUILD_CONTEXT_PATH
Can be specified when a DockerfilePath is specified outside the base
WorkspaceFolder. This path MUST be relative to the WorkspaceFolder
path into which the repo is cloned.
--cache-repo string, $ENVBUILDER_CACHE_REPO
The name of the container registry to push the cache image to. If this
is empty, the cache will not be pushed.
--cache-ttl-days int, $ENVBUILDER_CACHE_TTL_DAYS
The number of days to use cached layers before expiring them. Defaults
to 7 days.
--coder-agent-subsystem string-array, $CODER_AGENT_SUBSYSTEM
Coder agent subsystems to report when forwarding logs...+6238 more
from envbuilder.
^ It needs to be in the built and pushed image. See the acceptance criteria I added in the issue description.
from envbuilder.
Looks like it is already there. Here is the testing that I'm using to check that.
func TestEmbedBinaryImage(t *testing.T) {
t.Parallel()
srv := createGitServer(t, gitServerOptions{
files: map[string]string{
".devcontainer/Dockerfile": fmt.Sprintf("FROM %s\nRUN date --utc > /root/date.txt", testImageAlpine),
".devcontainer/devcontainer.json": `{
"name": "Test",
"build": {
"dockerfile": "Dockerfile"
},
}`,
},
})
testReg := setupInMemoryRegistry(t, setupInMemoryRegistryOpts{})
testRepo := testReg + "/test"
ref, err := name.ParseReference(testRepo + ":latest")
require.NoError(t, err)
_, err = runEnvbuilder(t, options{env: []string{
envbuilderEnv("GIT_URL", srv.URL),
envbuilderEnv("CACHE_REPO", testRepo),
envbuilderEnv("PUSH_IMAGE", "1"),
}})
require.NoError(t, err)
_, err = remote.Image(ref)
require.NoError(t, err, "expected image to be present after build + push")
ctr, err := runEnvbuilder(t, options{env: []string{
envbuilderEnv("FALLBACK_IMAGE", ref.String()),
}})
require.NoError(t, err)
out := execContainer(t, ctr, "[[ -f \"/.envbuilder/bin/envbuilder\" ]] && echo \"exists\"")
require.Equal(t, "exists", strings.TrimSpace(out))
}
from envbuilder.
Related to the following statement:
The binary could be located elsewhere too, so a lookup may be necessary.
Since we control where the binary is, do we need to lookup? Asking because we would have to install whereis
in the image to do something like whereis envbuilder
and use the path to copy the binary. Maybe another way would be to expose an option to tell envbuilder where the binary is ENVBUILDER_BIN_PATH
.
from envbuilder.
Related to the following statement:
The binary could be located elsewhere too, so a lookup may be necessary.
Since we control where the binary is, do we need to lookup? Asking because we would have to install
whereis
in the image to do something likewhereis envbuilder
and use the path to copy the binary. Maybe another way would be to expose an option to tell envbuilder where the binary isENVBUILDER_BIN_PATH
.
I don't think it's unreasonable to require the binary to be at a specific path.
from envbuilder.
fixed by #234
from envbuilder.
Related Issues (20)
- Dev Containers: Support volume mounts of devcontainer spec HOT 2
- Dev Containers: Script init and Entrypoint
- Error running devcontainer with container registry kubernetes secret volume mounted HOT 2
- Add support for feature order definition in devcontainer definitions
- usability: fix ownership of Docker volume mounts to /home HOT 1
- coder/kaniko: support multi-stage builds with DoCacheProbe HOT 1
- devcontainer: support multi-stage build with dangling build stage
- devcontainer: support docker-compose
- Implement devcontainer-lock.json
- Envbuilder create git repo folder with a trailing `.git`
- bug: lifecycle script `OnCreateCommand` is not executed.
- coder/kaniko: support caching ENV and ARG directives HOT 1
- Stop using deprecated codersdk.LogsSender function
- 401 error for requests to coder.example.com after "Update" option following template change HOT 3
- question: Ability to add features and/or modify feature parameters HOT 3
- feat: Add a way to select a specific branch before building the devcontainer HOT 2
- kubernetes: build with an initContainer or a Job HOT 2
- envbuilder - pass ssh key HOT 1
- envbuilder: fetch upstream changes from repo if local copy is not dirty HOT 5
- Add support for starting envbuilder from a built image
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 envbuilder.