Skip to content

Commit 18749a5

Browse files
committed
Remove devcontainer
Causing headaches
1 parent c698108 commit 18749a5

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

.devcontainer/Dockerfile

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,50 @@
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
55

6-
FROM python:3.7
6+
FROM python:3
77

88
# Avoid warnings by switching to noninteractive
99
ENV DEBIAN_FRONTEND=noninteractive
1010

11-
# Copy requirements.txt (if found) to a temp locaition so we can install it. Also
12-
# copy "noop.txt" so the COPY instruction does not fail if no requirements.txt exists.
13-
COPY requirements.txt* .devcontainer/noop.txt /tmp/pip-tmp/
11+
# Or your actual UID, GID on Linux if not the default 1000
12+
ARG USERNAME=vscode
13+
ARG USER_UID=1000
14+
ARG USER_GID=$USER_UID
15+
16+
# Copy requirements.txt (if found) to a temp location so we can install it. The `*`
17+
# is required so COPY doesn't think that part of the command should fail is nothing is
18+
# found. Also copy "noop.txt" so the COPY instruction copies _something_ to guarantee
19+
# success somehow.
20+
COPY *requirements.txt .devcontainer/noop.txt /tmp/pip-tmp/
1421

1522
# Configure apt and install packages
1623
RUN apt-get update \
17-
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
24+
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
1825
#
1926
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
2027
&& apt-get -y install git procps lsb-release \
2128
#
2229
# Install pylint
23-
&& pip install pylint \
30+
&& pip --disable-pip-version-check --no-cache-dir install pylint \
2431
#
2532
# Update Python environment based on requirements.txt (if presenet)
26-
&& if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip install -r /tmp/pip-tmp/requirements.txt; fi \
33+
&& if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt; fi \
2734
&& rm -rf /tmp/pip-tmp \
2835
#
36+
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
37+
&& groupadd --gid $USER_GID $USERNAME \
38+
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
39+
# [Optional] Uncomment the next three lines to add sudo support
40+
# && apt-get install -y sudo \
41+
# && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
42+
# && chmod 0440 /etc/sudoers.d/$USERNAME \
43+
#
2944
# Clean up
3045
&& apt-get autoremove -y \
3146
&& apt-get clean -y \
3247
&& rm -rf /var/lib/apt/lists/*
3348

3449
# Switch back to dialog for any ad-hoc use of apt-get
35-
ENV DEBIAN_FRONTEND=dialog
50+
ENV DEBIAN_FRONTEND=
3651

3752

.devcontainer/devcontainer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
1+
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at
2+
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/python-3
23
{
34
"name": "Python 3",
45
"context": "..",
@@ -10,12 +11,16 @@
1011
// Uncomment the next line to run commands after the container is created.
1112
// "postCreateCommand": "python --version",
1213

14+
// Uncomment the next line to use a non-root user. See https://aka.ms/vscode-remote/containers/non-root-user.
15+
// "runArgs": [ "-u", "1000" ],
16+
1317
"extensions": [
1418
"ms-python.python"
1519
],
1620
"settings": {
1721
"python.pythonPath": "/usr/local/bin/python",
1822
"python.linting.pylintEnabled": true,
23+
"python.linting.pylintPath": "/usr/local/bin/pylint",
1924
"python.linting.enabled": true
2025
}
21-
}
26+
}

0 commit comments

Comments
 (0)