Skip to content

Commit ea361b8

Browse files
committed
update devcontainer
1 parent 6d41a21 commit ea361b8

File tree

2 files changed

+7
-42
lines changed

2 files changed

+7
-42
lines changed

.devcontainer/Dockerfile

+3-41
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,9 @@
1-
#-------------------------------------------------------------------------------------------------------------
2-
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
4-
#-------------------------------------------------------------------------------------------------------------
5-
6-
FROM rust:1.47
7-
8-
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
9-
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
10-
# will be updated to match your local UID/GID (when using the dockerFile property).
11-
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
12-
ARG USERNAME=vscode
13-
ARG USER_UID=1000
14-
ARG USER_GID=$USER_UID
1+
FROM mcr.microsoft.com/vscode/devcontainers/rust:1
152

163
# Avoid warnings by switching to noninteractive
174
ENV DEBIAN_FRONTEND=noninteractive
18-
19-
# Configure apt and install packages
20-
RUN apt-get update \
21-
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
22-
#
23-
# Verify git, needed tools installed
24-
&& apt-get -y install git openssh-client less iproute2 procps lsb-release \
25-
#
26-
# Install lldb, vadimcn.vscode-lldb VSCode extension dependencies
27-
&& apt-get install -y lldb python3-minimal libpython3.7 \
28-
#
29-
# Install Rust components
30-
&& rustup update 2>&1 \
31-
&& rustup component add rls rust-analysis rust-src rustfmt clippy 2>&1 \
32-
#
33-
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
34-
&& groupadd --gid $USER_GID $USERNAME \
35-
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
36-
# [Optional] Add sudo support for the non-root user
37-
&& apt-get install -y sudo \
38-
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
39-
&& chmod 0440 /etc/sudoers.d/$USERNAME \
40-
#
41-
# Clean up
42-
&& apt-get autoremove -y \
43-
&& apt-get clean -y \
44-
&& rm -rf /var/lib/apt/lists/*
5+
RUN rustup update 2>&1 \
6+
&& rustup component add rls rust-analysis rust-src rustfmt clippy 2>&1
457

468
# Switch back to dialog for any ad-hoc use of apt-get
479
ENV DEBIAN_FRONTEND=dialog

.devcontainer/devcontainer.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"settings": {
77
"terminal.integrated.shell.linux": "/bin/bash",
88
"lldb.executable": "/usr/bin/lldb",
9-
"rust-analyzer.updates.askBeforeDownload": false
9+
"rust-analyzer.updates.askBeforeDownload": false,
10+
"files.watcherExclude": {
11+
"**/target/**": true
12+
}
1013
},
1114
// Add the IDs of extensions you want installed when the container is created.
1215
"extensions": [

0 commit comments

Comments
 (0)