Skip to content

Commit

Permalink
Use Docker image files in dev container config
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
StevenMaude committed Jun 19, 2024
1 parent 5bd648f commit 53e7f7a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
6 changes: 2 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"postCreateCommand": "/bin/bash .devcontainer/postCreate.sh ${containerWorkspaceFolder}",
"postAttachCommand": {
"rstudio-start": "sudo rstudio-server start"
},
"postCreateCommand": "/bin/bash /opt/devcontainer/postCreate.sh ${containerWorkspaceFolder}",
"postAttachCommand": "/bin/bash /opt/devcontainer/postAttach.sh",
"forwardPorts": [
8787
],
Expand Down
15 changes: 0 additions & 15 deletions .devcontainer/postCreate.sh

This file was deleted.

1 change: 0 additions & 1 deletion .devcontainer/requirements.in

This file was deleted.

0 comments on commit 53e7f7a

Please sign in to comment.