Skip to content

Commit aaea782

Browse files
committed
fix dev container
1 parent 8508be5 commit aaea782

File tree

4 files changed

+118
-11
lines changed

4 files changed

+118
-11
lines changed

.devcontainer/.dockerignore

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
*~
2+
_build
3+
*.obj
4+
*.out
5+
*.compile
6+
*.native
7+
*.byte
8+
*.cmo
9+
*.annot
10+
*.cmi
11+
*.cmx
12+
*.cmt
13+
*.cmti
14+
*.cma
15+
*.a
16+
*.cmxa
17+
*.obj
18+
*~
19+
*.annot
20+
*.mj
21+
*.bak
22+
*.swp
23+
*.swo
24+
*.flambda
25+
*.jsx
26+
*.lambda
27+
*.rawlambda
28+
*.s
29+
*.o
30+
*.lam
31+
*.0.js
32+
*#
33+
*.log
34+
.#*
35+
*.cmj
36+
*.rawlambda
37+
*.lambda
38+
*.zip
39+
*.mlast
40+
*.mliast
41+
42+
.idea
43+
.DS_Store
44+
45+
node_modules
46+
*.dump
47+
coverage
48+
49+
.ninja_log
50+
.bsdeps
51+
.bsbuild
52+
lib/ocaml
53+
tests/build_tests/*/lib/
54+
#ignore temporary directory
55+
*.goog.js
56+
*.jsoo.js
57+
*.so
58+
tmp/
59+
tracing*.json
60+
61+
_opam
62+
63+
.env
64+
playground/packages/
65+
playground/stdlib/
66+
playground/*.cmj
67+
playground/*.cmi
68+
playground/.netrc
69+
playground/compiler.*js
70+
71+
rewatch/target/
72+
rewatch/rewatch
73+
74+
tests/tools_tests/**/*.res.js
75+
tests/tools_tests/lib
76+
tests/analysis_tests*/lib
77+
tests/analysis_tests/**/*.bs.js
78+
79+
/linux/*.exe
80+
/linuxarm64/*.exe
81+
/darwin/*.exe
82+
/darwinarm64/*.exe
83+
/win32/*.exe
84+
85+
.yarn/*
86+
!.yarn/patches
87+
!.yarn/plugins
88+
!.yarn/releases
89+
!.yarn/sdks
90+
!.yarn/versions
91+
92+
*.tsbuildinfo
93+
94+
# package tarballs
95+
package.tgz
96+
*.exe
97+
98+
/ninja/ninja
99+
/ninja/build.ninja

.devcontainer/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ FROM mcr.microsoft.com/devcontainers/rust:1-1-bookworm
22
LABEL org.opencontainers.image.authors="Christoph Knittel <[email protected]>"
33
LABEL org.opencontainers.image.description="Docker image for ReScript development."
44

5-
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
RUN sudo apt-get update && export DEBIAN_FRONTEND=noninteractive \
66
&& apt-get -y install --no-install-recommends \
7-
yarn \
8-
opam \
7+
cmake \
8+
ninja-build \
99
musl-tools \
1010
python-is-python3 \
1111
&& rm -rf /var/lib/apt/lists/*
12+
13+
# Install OPAM
14+
ARG OPAM_VERSION=2.4.1
15+
RUN printf '\n\n' | bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version $OPAM_VERSION"

.devcontainer/devcontainer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
"name": "ReScript Compiler",
33
"build": {
44
"context": ".",
5-
"dockerfile": "Dockerfile"
5+
"dockerfile": "Dockerfile",
6+
"args": {
7+
"USER_UID": "${localEnv:UID}",
8+
"USER_GID": "${localEnv:GID}"
9+
}
610
},
711
"features": {
812
"ghcr.io/devcontainers/features/github-cli:1": {
@@ -23,5 +27,7 @@
2327
]
2428
}
2529
},
26-
"postCreateCommand": ".devcontainer/postCreate.sh"
30+
"postCreateCommand": ".devcontainer/postCreate.sh",
31+
"remoteUser": "vscode",
32+
"containerUser": "vscode"
2733
}

.devcontainer/postCreate.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
# Install dev dependencies from OPAM
44
opam init -y --bare --disable-sandboxing
5-
opam switch create 5.3.0 --packages ocaml-option-static
6-
opam install . --deps-only -y
7-
8-
# For IDE support, install the OCaml language server
9-
opam install ocaml-lsp-server -y
5+
opam switch create 5.3.0
6+
opam install . --deps-only --with-test --with-dev-setup -y
107

118
# Add OPAM environment setup to shell startup script
129
echo 'eval $(opam env)' >> ~/.zshrc
1310
echo 'eval $(opam env)' >> ~/.bashrc
1411

15-
npm install --ignore-scripts
12+
corepack enable
13+
printf "\n" | yarn

0 commit comments

Comments
 (0)