Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Clarify reason for blank file in python containers
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed Jun 13, 2019
1 parent 7aabfd7 commit b8831f7
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 18 deletions.
10 changes: 9 additions & 1 deletion containers/python-2/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ ENV DEBIAN_FRONTEND=noninteractive
# Set the default shell to bash rather than sh
ENV SHELL /bin/bash

# Copy requirements.txt (if found) to a temp locaition so we can install it. Also
# copy "noop.txt" so the COPY instruction does not fail if no requirements.txt exists.
COPY requirements.txt* .devcontainer/noop.txt /tmp/pip-tmp/

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
Expand All @@ -20,10 +24,14 @@ RUN apt-get update \
# Install pylint
&& pip install pylint \
#
# Update Python environment based on requirements.txt (if presenet)
&& if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip install -r /tmp/pip-tmp/requirements.txt; fi \
&& rm -rf /tmp/pip-tmp \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog
ENV DEBIAN_FRONTEND=dialog
7 changes: 4 additions & 3 deletions containers/python-2/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "java -version",

"extensions": [
"ms-python.python"
],
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
},
// Install contents of requirements.txt if present
"postCreateCommand": "if [ -f requirements.txt ]; then pip install -r requirements.txt; fi"
}
}
3 changes: 3 additions & 0 deletions containers/python-2/.devcontainer/noop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file copied into the container along with requirements.txt* from the parent
folder. This file is included to prevents the Dockerfile COPY instruction from
failing if no requirements.txt is found.
8 changes: 8 additions & 0 deletions containers/python-3-anaconda/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ ENV DEBIAN_FRONTEND=noninteractive
# Set the default shell to bash rather than sh
ENV SHELL /bin/bash

# Copy environment.yml (if found) to a temp locaition so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
Expand All @@ -20,6 +24,10 @@ RUN apt-get update \
# Install pylint
&& pip install pylint \
#
# Update Python environment based on environment.yml (if presenet)
&& if [ -f "/tmp/conda-tmp/environment.yml" ]; then conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
Expand Down
4 changes: 1 addition & 3 deletions containers/python-3-anaconda/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@
"python.pythonPath": "/opt/conda/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
},
// Install contents of environment.yml if present
"postCreateCommand": "if [ -f environment.yml ]; then conda env update base -f environment.yml; fi"
}
}
3 changes: 3 additions & 0 deletions containers/python-3-anaconda/.devcontainer/noop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file copied into the container along with environment.yml* from the parent
folder. This file is included to prevents the Dockerfile COPY instruction from
failing if no environment.yml is found.
8 changes: 8 additions & 0 deletions containers/python-3-miniconda/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ ENV DEBIAN_FRONTEND=noninteractive
# Set the default shell to bash rather than sh
ENV SHELL /bin/bash

# Copy environment.yml (if found) to a temp locaition so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
Expand All @@ -20,6 +24,10 @@ RUN apt-get update \
# Install pylint
&& pip install pylint \
#
# Update Python environment based on environment.yml (if presenet)
&& if [ -f "/tmp/conda-tmp/environment.yml" ]; then conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@
"python.pythonPath": "/opt/conda/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
},
// Install contents of environment.yml if present
"postCreateCommand": "if [ -f environment.yml ]; then conda env update base -f environment.yml; fi"
}
}
3 changes: 3 additions & 0 deletions containers/python-3-miniconda/.devcontainer/noop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file copied into the container along with environment.yml* from the parent
folder. This file is included to prevents the Dockerfile COPY instruction from
failing if no environment.yml is found.
3 changes: 2 additions & 1 deletion containers/python-3-miniconda/environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dependencies:
- jupyter
- numpy
- matplotlib
- matplotlib

10 changes: 9 additions & 1 deletion containers/python-3-postgres/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ ENV SHELL /bin/bash

ENV PYTHONUNBUFFERED 1

# Copy requirements.txt (if found) to a temp locaition so we can install it. Also
# copy "noop.txt" so the COPY instruction does not fail if no requirements.txt exists.
COPY requirements.txt* .devcontainer/noop.txt /tmp/pip-tmp/

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
Expand All @@ -22,10 +26,14 @@ RUN apt-get update \
# Install pylint
&& pip install pylint \
#
# Update Python environment based on requirements.txt (if presenet)
&& if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip install -r /tmp/pip-tmp/requirements.txt; fi \
&& rm -rf /tmp/pip-tmp \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog
ENV DEBIAN_FRONTEND=dialog
4 changes: 1 addition & 3 deletions containers/python-3-postgres/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@
"python.pythonPath": "/usr/local/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
},
// Install contents of environment.yml if present
"postCreateCommand": "if [ -f environment.yml ]; conda env update base -f environment.yml; fi"
}
}
3 changes: 3 additions & 0 deletions containers/python-3-postgres/.devcontainer/noop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file copied into the container along with requirements.txt* from the parent
folder. This file is included to prevents the Dockerfile COPY instruction from
failing if no requirements.txt is found.
8 changes: 8 additions & 0 deletions containers/python-3/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ ENV DEBIAN_FRONTEND=noninteractive
# Set the default shell to bash rather than sh
ENV SHELL /bin/bash

# Copy requirements.txt (if found) to a temp locaition so we can install it. Also
# copy "noop.txt" so the COPY instruction does not fail if no requirements.txt exists.
COPY requirements.txt* .devcontainer/noop.txt /tmp/pip-tmp/

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
Expand All @@ -20,6 +24,10 @@ RUN apt-get update \
# Install pylint
&& pip install pylint \
#
# Update Python environment based on requirements.txt (if presenet)
&& if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip install -r /tmp/pip-tmp/requirements.txt; fi \
&& rm -rf /tmp/pip-tmp \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
Expand Down
4 changes: 1 addition & 3 deletions containers/python-3/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@
"python.pythonPath": "/usr/local/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
},
// Install contents of requirements.txt if present
"postCreateCommand": "if [ -f requirements.txt ]; then pip install -r requirements.txt; fi"
}
}
3 changes: 3 additions & 0 deletions containers/python-3/.devcontainer/noop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file copied into the container along with requirements.txt* from the parent
folder. This file is included to prevents the Dockerfile COPY instruction from
failing if no requirements.txt is found.

0 comments on commit b8831f7

Please sign in to comment.