Skip to content

Commit adebdc0

Browse files
committed
Simplify Dockerfile and devcontainer
1 parent e8e2e65 commit adebdc0

File tree

4 files changed

+28
-41
lines changed

4 files changed

+28
-41
lines changed

.devcontainer/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM mcr.microsoft.com/devcontainers/rust:1-1-bookworm
2+
LABEL org.opencontainers.image.authors="Christoph Knittel <ck@cca.io>"
3+
LABEL org.opencontainers.image.description="Docker image for ReScript development."
4+
5+
RUN apt update && apt install -y --no-install-recommends opam musl-tools python-is-python3
6+
7+
# OCaml
8+
# RUN opam init -y --bare --disable-sandboxing git+https://github.com/rescript-lang/opam-repository
9+
# RUN opam switch create 5.2.0 --packages ocaml-option-static
10+
# RUN opam install -y dune cppo=1.6.9 js_of_ocaml-compiler=5.8.1 ocamlformat=0.26.2 ounit2=2.2.7 reanalyze=2.25.1

.devcontainer/devcontainer.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
{
22
"name": "ReScript Compiler",
33
"build": {
4-
"context": "..",
5-
"dockerfile": "../docker/Dockerfile"
4+
"context": ".",
5+
"dockerfile": "Dockerfile"
66
},
77
"features": {
8-
"ghcr.io/devcontainers/features/github-cli:1":{}
8+
"ghcr.io/devcontainers/features/github-cli:1":{
9+
"installDirectlyFromGitHubRelease": true,
10+
"version": "latest"
11+
},
12+
"ghcr.io/devcontainers/features/node:1": {
13+
"version":"20"
14+
}
915
},
1016
"customizations": {
1117
"vscode": {
1218
"extensions": [
1319
"chenglou92.rescript-vscode",
1420
"biomejs.biome"
15-
],
16-
"settings": {
17-
"terminal.integrated.defaultProfile.linux": "bash"
18-
}
21+
]
1922
}
2023
},
21-
"postCreateCommand": ".devcontainer/postCreate.sh",
22-
"remoteUser": "devuser"
24+
"postCreateCommand": ".devcontainer/postCreate.sh"
2325
}

.devcontainer/postCreate.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
#!/bin/bash
1+
#!/bin/sh
2+
3+
# Opam stuff post install
4+
opam init -y --bare --disable-sandboxing git+https://github.com/rescript-lang/opam-repository
5+
opam switch create 5.2.0 --packages ocaml-option-static
6+
opam install -y dune cppo=1.6.9 js_of_ocaml-compiler=5.8.1 ocamlformat=0.26.2 ounit2=2.2.7 reanalyze=2.25.1
27

38
# Install dev dependencies from OPAM
49
opam install . --deps-only -y
@@ -7,6 +12,6 @@ opam install . --deps-only -y
712
opam install ocaml-lsp-server -y
813

914
# Add OPAM environment setup to shell startup script
10-
echo 'eval $(opam env)' >> ~/.bashrc
15+
echo 'eval $(opam env)' >> ~/.zshrc
1116

1217
npm install --ignore-scripts

docker/Dockerfile

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)