Repository navigation
Copy files into one container per solution, docker exec each run - #341
Closed
AydinHassan wants to merge 4 commits into
Closed
AydinHassan wants to merge 4 commits into
AydinHassan wants to merge 4 commits into
Conversation
Nothing is mounted from this machine any more, so the docker host can be another one. Runs of a folder share a container, removed with the sandbox. Composer and runs with exposed ports get their own, composer copies composer.lock (and vendor when there is no volume) back.
…s, flag pairs on one line
…endor back from composer
AydinHassan
marked this pull request as draft
November 1, 2026 07:36
3 of 5 tasks
Member
Author
|
Superseded: being rewritten on the new Sandbox classes, see #336 |
AydinHassan
added a commit
that referenced
this pull request
Nov 1, 2026
Part of #336, replaces #341. - `DockerSandboxFactory::create()` starts the solution's container (`docker run -d --rm ... sleep 300`, same isolation flags) and copies the directory in with `docker cp`. Nothing is mounted, so the docker host can be remote. - `DockerSandbox::execute()` is a `docker exec` with `timeout -s KILL 30`. - `DockerSandbox::finish()` copies back the context's solution files (eg. `db.sqlite`) with `docker cp`, removes the container and releases the port. The port lock lasts 300s, as long as a container lives. - Tests use `test/res/fake-docker`, which logs its args. Tried with real Docker: learn-you-php Database Read (pass, and a broken solution fails the database check), Time Server, php8-appreciate All Mixed Up (`param.log` comes back, File Comparison passes). No containers left behind.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task 5 of #336.
DOCKER_HOSTcan point at another machine.create+start+ tar once, thendocker execper run). It is removed when the sandbox is.-p. After composer,composer.lockcomes back (andvendor/when there is no vendor volume)./solutionis an anonymous volume, so it is writable under--read-onlyand a new vendor volume still takes the image's 1777 permissions.learn-you-php dependency-heaven verify, docker, locally: 6.0s → 2.5s.