Skip to content

Commit a9bfd68

Browse files
committed
Fix devcontainer
1 parent 43e4766 commit a9bfd68

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

.devcontainer/Dockerfile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ RUN apt-get update && apt-get install -y \
77

88
RUN pip install clang-format pre-commit
99

10-
WORKDIR /temp-repo
10+
COPY docker-entrypoint.sh /
11+
RUN chmod +x /docker-entrypoint.sh
1112

12-
COPY .pre-commit-config.yaml .
13-
14-
RUN git init . && pre-commit install --install-hooks
15-
16-
WORKDIR /
17-
18-
RUN rm -rf temp-repo
13+
ENTRYPOINT [ "/docker-entrypoint.sh" ]
14+
CMD [ "sleep", "infinity" ]

.devcontainer/devcontainer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "C++",
55
"build": {
66
"dockerfile": "Dockerfile",
7-
"context": ".."
7+
"cacheFrom": "ghcr.io/volumegraphics/traits-devcontainer"
88
},
99

1010
// Features to add to the dev container. More info: https://containers.dev/features.
@@ -31,7 +31,9 @@
3131
"twxs.cmake"
3232
]
3333
}
34-
}
34+
},
35+
36+
"overrideCommand": false
3537

3638
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
3739
// "remoteUser": "root"

.devcontainer/docker-entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
pre-commit install --install-hooks
4+
5+
exec "$@"

0 commit comments

Comments
 (0)