Skip to content

Commit 2a0189b

Browse files
committed
ADD vscode user in docker
Signed-off-by: Shunsuke Kimura <[email protected]>
1 parent 8c99125 commit 2a0189b

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
# Rust v1.77 as a base image
21
FROM rust:1.77-slim
32

4-
RUN apt-get update \
3+
ARG USERNAME=vscode
4+
ARG USER_UID=1000
5+
ARG USER_GID=$USER_UID
6+
7+
RUN groupadd --gid $USER_GID $USERNAME \
8+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
9+
&& chsh -s /bin/bash $USERNAME \
10+
&& apt-get update \
511
&& apt-get install -y --no-install-recommends \
612
git \
713
openssh-client \
@@ -13,3 +19,4 @@ RUN apt-get update \
1319

1420
WORKDIR /workspace
1521
ENV PATH="/root/.cargo/bin:${PATH}"
22+
USER $USERNAME

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"dockerfile": "Dockerfile",
55
"context": ".."
66
},
7+
"remoteUser": "vscode",
78
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
89
"workspaceFolder": "/workspace",
910
"postStartCommand": "cargo test --package typst-docs --lib -- tests::test_docs --exact --nocapture && python3 ./gen.py && python3 -m http.server -d dist",

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"label": "gen: typst-jp documentation",
66
"type": "shell",
7-
"command": "cargo test --package typst-docs --lib -- tests::test_docs --exact --nocapture && python3 ./gen.py && echo reload or open http://localhost:3000",
7+
"command": "cargo test --package typst-docs --lib -- tests::test_docs --exact --nocapture && python3 ./gen.py && echo reload or open http://localhost:8000",
88
"problemMatcher": []
99
}
1010
]

0 commit comments

Comments
 (0)