exercism / rust-test-runner

GNU Affero General Public License v3.0
3 stars 15 forks source link

Configure the env-vars that docker implicitly sets #4

Closed ccare closed 4 years ago

ccare commented 4 years ago

Hi @coriolinus,

Hopefully this will be a reasonably non-controversial change. We've had to do this for a few other tracks.

Although we're building the container images from Dockerfiles, we're not invoking them through Docker (instead we're exporting them as OCI containers and invoking with runc). As a result, the implicit runtime config that gets set via the Dockerfile chain is missing from our invocation environment,

Specifically, we need the ENV directives that were set from the base image Dockerfile, see

https://github.com/rust-lang/docker-rust/blob/3898d19194231639f1afc3096bd04702eaf555e7/1.40.0/buster/Dockerfile#L3

ccare commented 4 years ago

Is there a reason this ended up in run.sh instead of Dockerfile?

Yes, so basically we're not using the Dockerfile to run the container. We make the image, push it and thereafter the contents of the Dockerfile are irrelevant. At runtime there's an OCI config.json file where env-vars can be set (and this is the technically the correct place to put the equivalent config of a Dockerfile ENV statement.) However, this config file is currently written in a track-agnostic way, so the pragmatic decision was put the env-var in the run.sh.