upaas builds an app by uploading its clone as a tar (archive.TarWithOptions(opts.ContextDir, &archive.TarOptions{}) in performBuild, internal/docker/client.go), with no exclude patterns. Docker does not filter a tar context through the app's .dockerignore: on the build host, docker build - with a tar on standard input and a build through the Docker API with BuildKit (how upaas builds) both received every file, as the review of sneak/webhooker#410 found.
So an upaas build sees a different context from docker build . on the same clone: everything an app's .dockerignore leaves out reaches the build. In particular, the version-stamping convention (sneak/project-management#21) sends .git but leaves out .git/config, which can hold a credential in the remote URL; under upaas that file reaches the builder stage's layers. upaas's own clones use a deploy key, so their URLs hold none today, but the context still differs from the app's intent.
Definition of done:
When it makes the build-context tar, upaas reads the app's .dockerignore (next to the Dockerfile it builds, as the Docker CLI does) and passes its patterns as exclude patterns, using the same pattern library the Docker CLI uses (github.com/moby/patternmatcher and its ignorefile reader), so an upaas build sees exactly the context docker build . sees.
An app without a .dockerignore builds exactly as today.
A test builds the tar for a context with a .dockerignore that excludes a file and a ! re-include, and checks which files are in it.
Model: opus-5-5
upaas builds an app by uploading its clone as a tar (`archive.TarWithOptions(opts.ContextDir, &archive.TarOptions{})` in `performBuild`, `internal/docker/client.go`), with no exclude patterns. Docker does not filter a tar context through the app's `.dockerignore`: on the build host, `docker build -` with a tar on standard input and a build through the Docker API with BuildKit (how upaas builds) both received every file, as the review of https://git.eeqj.de/sneak/webhooker/pulls/410 found.
So an upaas build sees a different context from `docker build .` on the same clone: everything an app's `.dockerignore` leaves out reaches the build. In particular, the version-stamping convention (https://git.eeqj.de/sneak/project-management/issues/21) sends `.git` but leaves out `.git/config`, which can hold a credential in the remote URL; under upaas that file reaches the builder stage's layers. upaas's own clones use a deploy key, so their URLs hold none today, but the context still differs from the app's intent.
Definition of done:
- When it makes the build-context tar, upaas reads the app's `.dockerignore` (next to the Dockerfile it builds, as the Docker CLI does) and passes its patterns as exclude patterns, using the same pattern library the Docker CLI uses (`github.com/moby/patternmatcher` and its `ignorefile` reader), so an upaas build sees exactly the context `docker build .` sees.
- An app without a `.dockerignore` builds exactly as today.
- A test builds the tar for a context with a `.dockerignore` that excludes a file and a `!` re-include, and checks which files are in it.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
upaas builds an app by uploading its clone as a tar (
archive.TarWithOptions(opts.ContextDir, &archive.TarOptions{})inperformBuild,internal/docker/client.go), with no exclude patterns. Docker does not filter a tar context through the app's.dockerignore: on the build host,docker build -with a tar on standard input and a build through the Docker API with BuildKit (how upaas builds) both received every file, as the review of sneak/webhooker#410 found.So an upaas build sees a different context from
docker build .on the same clone: everything an app's.dockerignoreleaves out reaches the build. In particular, the version-stamping convention (sneak/project-management#21) sends.gitbut leaves out.git/config, which can hold a credential in the remote URL; under upaas that file reaches the builder stage's layers. upaas's own clones use a deploy key, so their URLs hold none today, but the context still differs from the app's intent.Definition of done:
.dockerignore(next to the Dockerfile it builds, as the Docker CLI does) and passes its patterns as exclude patterns, using the same pattern library the Docker CLI uses (github.com/moby/patternmatcherand itsignorefilereader), so an upaas build sees exactly the contextdocker build .sees..dockerignorebuilds exactly as today..dockerignorethat excludes a file and a!re-include, and checks which files are in it.Model: opus-5-5