opensafely / research-template

The template for new research projects that use the OpenSAFELY framework.
MIT License
16 stars 13 forks source link

Use Docker image files in dev container config #137

Closed StevenMaude closed 5 months ago

StevenMaude commented 5 months ago

See opensafely-core/research-template-docker#32.

In opensafely-core/research-template-docker#57, we moved this configuration to the Docker image.

We can now update the dev container configuration here to use those Docker image files.

Note that postAttachCommand now becomes a string, instead of an object; the object format allows for running multiple commands in parallel:

https://containers.dev/implementors/json_reference/#formatting-string-vs-array-properties

However, for our use case, this is fine for now as we only run one simple script (that only starts R Studio currently).

StevenMaude commented 5 months ago

For this updated configuration to work, we need a new Docker image built and published following a merge of opensafely-core/research-template-docker/pull/57.

StevenMaude commented 5 months ago

I tested this by running the dev container tests in research-template-docker.

This edited the test workflow there to use the updated dev image built from https://github.com/opensafely-core/research-template-docker/pull/57 and a dev container JSON configuration as in this PR.

Run: https://github.com/opensafely-core/research-template-docker/actions/runs/9581024301

Once the image is available, I can check that a Codespace created from this branch works as expected, as a final check.

StevenMaude commented 5 months ago

Needs a rebuild and another check following https://github.com/opensafely-core/research-template-docker/pull/59.

StevenMaude commented 5 months ago

I checked this in Codespaces launched from this branch: