Skip to content

Commit 78ca891

Browse files
get docker working with git
1 parent 4e10d87 commit 78ca891

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

.devcontainer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"build": {
33
"dockerfile": "Dockerfile"
44
},
5-
"workspaceFolder": "/workspace",
5+
"workspaceFolder": "/home/developer/unit-scaling",
66
"customizations": {
77
"vscode": {
88
"extensions": [
@@ -16,6 +16,9 @@
1616
}
1717
},
1818
"mounts": [
19-
"source=${localWorkspaceFolder},target=/workspace,type=bind"
20-
]
19+
"source=${localEnv:HOME}/.ssh,target=/home/developer/.ssh,type=bind,readonly=true",
20+
"source=${localEnv:HOME}/.gitconfig,target=/home/developer/.gitconfig,type=bind,readonly=true",
21+
"source=${localWorkspaceFolder},target=/home/developer/unit-scaling,type=bind"
22+
],
23+
"remoteUser": "developer"
2124
}

Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@ RUN apt-get update && apt-get install -y \
1212
&& chsh -s /bin/zsh \
1313
&& apt-get clean && rm -rf /var/lib/apt/lists/* # cleanup (smaller image)
1414

15-
# Set working directory
16-
WORKDIR /workspace
17-
18-
# Install Python dependencies
19-
COPY requirements-dev.txt .
20-
RUN pip install -r requirements-dev.txt
21-
22-
# Puts pip install libs on $PATH & sets correct locale
23-
ENV PATH="$PATH:/home/$USERNAME/.local/bin" \
24-
LC_ALL=C.UTF-8
25-
2615
# Configure a non-root user with sudo privileges
2716
ARG USERNAME=developer # Change this to preferred username
2817
ARG USER_UID=1001
@@ -33,6 +22,17 @@ RUN groupadd --gid $USER_GID $USERNAME \
3322
&& chmod 0440 /etc/sudoers.d/$USERNAME
3423
USER $USERNAME
3524

25+
# Set working directory
26+
WORKDIR /home/$USERNAME/unit-scaling
27+
28+
# Puts pip install libs on $PATH & sets correct locale
29+
ENV PATH="$PATH:/home/$USERNAME/.local/bin" \
30+
LC_ALL=C.UTF-8
31+
32+
# Install Python dependencies
33+
COPY requirements-dev.txt .
34+
RUN pip install -r requirements-dev.txt
35+
3636
# Creates basic .zshrc
3737
RUN sudo cp /etc/zsh/newuser.zshrc.recommended /home/$USERNAME/.zshrc
3838

0 commit comments

Comments
 (0)