Skip to content

Commit c553ad7

Browse files
Jekyll - Fix bug "cannot open ./.devcontainer/post-create.sh: No such file" (devcontainers#390)
* Jekyll - Fix bug "cannot open ./.devcontainer/post-create.sh: No such file" * fix test
1 parent 3f7fca0 commit c553ad7

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/jekyll/.devcontainer/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ARG VARIANT=2.7-bullseye
33
FROM mcr.microsoft.com/devcontainers/ruby:${VARIANT}
44

55
USER root
6+
67
# ENV Variables required by Jekyll
78
ENV LANG=en_US.UTF-8 \
89
LANGUAGE=en_US:en \
@@ -15,9 +16,11 @@ ENV LANG=en_US.UTF-8 \
1516
RUN gem update --system
1617
RUN gem install bundler jekyll github-pages
1718

18-
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
19-
ARG NODE_VERSION="none"
20-
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
19+
RUN chown -R "vscode:rvm" "/usr/local/rvm/" \
20+
&& chmod -R g+r+w "/usr/local/rvm/" \
21+
&& find "/usr/local/rvm/" -type d | xargs -n 1 chmod g+s
22+
23+
COPY post-create.sh /usr/local/post-create.sh
2124

2225
# [Optional] Uncomment this section to install additional OS packages.
2326
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \

src/jekyll/.devcontainer/devcontainer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"context": "."
55
},
66
"features": {
7+
"ghcr.io/devcontainers/features/node:1": {
8+
"version": "none"
9+
},
710
"ghcr.io/devcontainers/features/git:1": {
811
"version": "latest",
912
"ppa": "false"
@@ -18,7 +21,7 @@
1821
],
1922

2023
// Use 'postCreateCommand' to run commands after the container is created.
21-
"postCreateCommand": "sh ./.devcontainer/post-create.sh",
24+
"postCreateCommand": "sh /usr/local/post-create.sh",
2225

2326
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
2427
"remoteUser": "vscode"

src/jekyll/test-project/test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@ check "gitconfig-contains-name" sh -c "cat /etc/gitconfig | grep 'name = devcont
2727

2828
check "usr-local-etc-config-does-not-exist" test ! -f "/usr/local/etc/gitconfig"
2929

30+
check "post-create-exists" test -f /usr/local/post-create.sh
31+
3032
# Report result
3133
reportResults

0 commit comments

Comments
 (0)