This repository was archived by the owner on Nov 30, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 16 files changed +67
-18
lines changed
python-3-anaconda/.devcontainer
python-3-postgres/.devcontainer Expand file tree Collapse file tree 16 files changed +67
-18
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ ENV DEBIAN_FRONTEND=noninteractive
10
10
# Set the default shell to bash rather than sh
11
11
ENV SHELL /bin/bash
12
12
13
+ # Copy requirements.txt (if found) to a temp locaition so we can install it. Also
14
+ # copy "noop.txt" so the COPY instruction does not fail if no requirements.txt exists.
15
+ COPY requirements.txt* .devcontainer/noop.txt /tmp/pip-tmp/
16
+
13
17
# Configure apt and install packages
14
18
RUN apt-get update \
15
19
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
@@ -20,10 +24,14 @@ RUN apt-get update \
20
24
# Install pylint
21
25
&& pip install pylint \
22
26
#
27
+ # Update Python environment based on requirements.txt (if presenet)
28
+ && if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip install -r /tmp/pip-tmp/requirements.txt; fi \
29
+ && rm -rf /tmp/pip-tmp \
30
+ #
23
31
# Clean up
24
32
&& apt-get autoremove -y \
25
33
&& apt-get clean -y \
26
34
&& rm -rf /var/lib/apt/lists/*
27
35
28
36
# Switch back to dialog for any ad-hoc use of apt-get
29
- ENV DEBIAN_FRONTEND=dialog
37
+ ENV DEBIAN_FRONTEND=dialog
Original file line number Diff line number Diff line change 6
6
// Uncomment the next line if you want to publish any ports.
7
7
// "appPort": [],
8
8
9
+ // Uncomment the next line to run commands after the container is created.
10
+ // "postCreateCommand": "java -version",
11
+
9
12
"extensions" : [
10
13
" ms-python.python"
11
14
],
12
15
"settings" : {
13
16
"python.pythonPath" : " /usr/local/bin/python" ,
14
17
"python.linting.pylintEnabled" : true ,
15
18
"python.linting.enabled" : true
16
- },
17
- // Install contents of requirements.txt if present
18
- "postCreateCommand" : " if [ -f requirements.txt ]; then pip install -r requirements.txt; fi"
19
+ }
19
20
}
Original file line number Diff line number Diff line change
1
+ This file copied into the container along with requirements.txt* from the parent
2
+ folder. This file is included to prevents the Dockerfile COPY instruction from
3
+ failing if no requirements.txt is found.
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ ENV DEBIAN_FRONTEND=noninteractive
10
10
# Set the default shell to bash rather than sh
11
11
ENV SHELL /bin/bash
12
12
13
+ # Copy environment.yml (if found) to a temp locaition so we update the environment. Also
14
+ # copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
15
+ COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
16
+
13
17
# Configure apt and install packages
14
18
RUN apt-get update \
15
19
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
@@ -20,6 +24,10 @@ RUN apt-get update \
20
24
# Install pylint
21
25
&& pip install pylint \
22
26
#
27
+ # Update Python environment based on environment.yml (if presenet)
28
+ && if [ -f "/tmp/conda-tmp/environment.yml" ]; then conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
29
+ && rm -rf /tmp/conda-tmp \
30
+ #
23
31
# Clean up
24
32
&& apt-get autoremove -y \
25
33
&& apt-get clean -y \
Original file line number Diff line number Diff line change 16
16
"python.pythonPath" : " /opt/conda/bin/python" ,
17
17
"python.linting.pylintEnabled" : true ,
18
18
"python.linting.enabled" : true
19
- },
20
- // Install contents of environment.yml if present
21
- "postCreateCommand" : " if [ -f environment.yml ]; then conda env update base -f environment.yml; fi"
19
+ }
22
20
}
Original file line number Diff line number Diff line change
1
+ This file copied into the container along with environment.yml* from the parent
2
+ folder. This file is included to prevents the Dockerfile COPY instruction from
3
+ failing if no environment.yml is found.
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ ENV DEBIAN_FRONTEND=noninteractive
10
10
# Set the default shell to bash rather than sh
11
11
ENV SHELL /bin/bash
12
12
13
+ # Copy environment.yml (if found) to a temp locaition so we update the environment. Also
14
+ # copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
15
+ COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
16
+
13
17
# Configure apt and install packages
14
18
RUN apt-get update \
15
19
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
@@ -20,6 +24,10 @@ RUN apt-get update \
20
24
# Install pylint
21
25
&& pip install pylint \
22
26
#
27
+ # Update Python environment based on environment.yml (if presenet)
28
+ && if [ -f "/tmp/conda-tmp/environment.yml" ]; then conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
29
+ && rm -rf /tmp/conda-tmp \
30
+ #
23
31
# Clean up
24
32
&& apt-get autoremove -y \
25
33
&& apt-get clean -y \
Original file line number Diff line number Diff line change 16
16
"python.pythonPath" : " /opt/conda/bin/python" ,
17
17
"python.linting.pylintEnabled" : true ,
18
18
"python.linting.enabled" : true
19
- },
20
- // Install contents of environment.yml if present
21
- "postCreateCommand" : " if [ -f environment.yml ]; then conda env update base -f environment.yml; fi"
19
+ }
22
20
}
Original file line number Diff line number Diff line change
1
+ This file copied into the container along with environment.yml* from the parent
2
+ folder. This file is included to prevents the Dockerfile COPY instruction from
3
+ failing if no environment.yml is found.
Original file line number Diff line number Diff line change 1
1
dependencies :
2
2
- jupyter
3
3
- numpy
4
- - matplotlib
4
+ - matplotlib
5
+
You can’t perform that action at this time.
0 commit comments