Skip to content

Commit

Permalink
chore: fix missing user builder for devcontainer (databendlabs#12402)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc authored Aug 9, 2023
1 parent 7ed0933 commit beb905a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ RUN apt-get update && apt-get install -y git ripgrep && \
chmod +x /tmp/install.sh && \
/tmp/install.sh --yes && \
printf 'eval "$(starship init bash)"' >> /etc/bash.bashrc && \
curl -sSLo /tmp/lsd.deb https://github.com/Peltoche/lsd/releases/download/0.21.0/lsd_0.21.0_amd64.deb && \
dpkg -i /tmp/lsd.deb && \
rm -rf /tmp/* /var/lib/apt/lists/*

RUN useradd -u 1000 builder
RUN mkdir /home/builder && chown -R builder /home/builder && \
usermod --shell /bin/bash builder
RUN printf "builder ALL=(ALL:ALL) NOPASSWD:ALL\n" > /etc/sudoers.d/databend

USER builder
23 changes: 13 additions & 10 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"name": "Databend",
"extensions": [
"cschleiden.vscode-github-actions",
"rust-lang.rust-analyzer",
"serayuzgur.crates",
"vadimcn.vscode-lldb"
],
"mounts": [
"source=${localEnv:HOME}/.cargo/registry,target=/opt/rust/cargo/registry,type=bind,consistency=cached",
"source=${localEnv:HOME}/.cargo/git,target=/opt/rust/cargo/git,type=bind,consistency=cached",
Expand All @@ -15,10 +9,19 @@
"remoteUser": "builder",
"updateRemoteUserUID": true,
"postCreateCommand": "sudo chown -R builder /opt/rust",
"settings": {
"editor.formatOnSave": true,
"files.exclude": {
"**/LICENSE": true
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"serayuzgur.crates",
"vadimcn.vscode-lldb"
],
"settings": {
"editor.formatOnSave": true,
"files.exclude": {
"**/LICENSE": true
}
}
}
}
}

0 comments on commit beb905a

Please sign in to comment.