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

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed Apr 2, 2019
1 parent e441fb2 commit 64bff0f
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 23 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ The other definitions in the `containers` folder will provide examples of how to

You can easily share a customized dev container definition for your project by simply adding files like `.vscode/devContainer.json` to source control. By including these files in your repository, anyone that opens a local copy of your repo in VS Code will be automatically asked if they want reopen the folder in a container instead if the [Remote Development](https://aka.ms/vscode-remote/download/extension) extension installed.

You can also have VS Code prompt anyone opening your repo to install the Remote Development extension. Simply add the extension ID to `recommendations` array in `.vscode/extensions.json` (as described [here](https://code.visualstudio.com/docs/editor/extension-gallery#_workspace-recommended-extensions)) and then add the file to source control.

```json
{
"recommendations": [
"vscode.remote-development"
]
}
```

Beyond the advantages of having your team use a consistent environment and tool-chain, doing this can make it easier for new contributors or team members to get productive quickly. First-time contributors will require less guidance and are less likely to either submit issues or contribute code with issues that are related to environment setup.

## Contents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ version: '3'
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
your-service-name-here:
# Uncomment if you want to add a different Dockerfile in the .devcontainer folder
# build:
# context: .
# dockerfile: Dockerfile

volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- .:/workspace
- ..:/workspace

# Forwarding the socket is optional, but lets docker work inside the container if you install the Docker CLI.
# See the docker-in-docker-compose definition for details on how to install it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ services:
docker-in-docker:
build:
context: .
dockerfile: .devcontainer/Dockerfile
dockerfile: Dockerfile
volumes:
- .:/workspace
- ..:/workspace

# Forwarding the socket is the key to getting this to work
- /var/run/docker.sock:/var/run/docker.sock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ services:
web:
build:
context: .
dockerfile: .devcontainer/Dockerfile
dockerfile: Dockerfile
volumes:
- .:/app
- ..:/app
ports:
- "3000:3000"
command: sleep infinity
Expand Down
2 changes: 1 addition & 1 deletion containers/python-2/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
FROM python:2-slim

# Copy endpoint specific user settings overrides into container to specify Python path
COPY settings.vscode.json /root/.vscode-remote/data/User/settings.json
COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/User/settings.json

RUN pip install pylint

Expand Down
3 changes: 3 additions & 0 deletions containers/python-3-django/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

FROM python:3-slim

# Copy default endpoint specific user settings overrides into container to specify Python path
COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/User/settings.json

ENV PYTHONUNBUFFERED 1

RUN pip install pylint
Expand Down
4 changes: 4 additions & 0 deletions containers/python-3-django/.devcontainer/settings.vscode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"python.linting.pylintEnabled": true,
"python.pythonPath": "/usr/local/bin/python"
}
5 changes: 4 additions & 1 deletion containers/python-3-flask-redis/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@

FROM python:3-slim

# Copy default endpoint specific user settings overrides into container to specify Python path
COPY settings.vscode.json /root/.vscode-remote/data/User/settings.json

RUN mkdir /app
WORKDIR /app

COPY .devcontainer/requirements.txt /app/
COPY requirements.txt /app/
RUN pip install -r requirements.txt

RUN pip install pylint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
ports:
- "5000:5000"
volumes:
- .:/app
- ..:/app
command: sleep infinity
redis:
image: "redis:alpine"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/local/bin/python"
}
2 changes: 1 addition & 1 deletion containers/python-3-flask-redis/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"python.linting.pylintEnabled": true
"python.pythonPath": "/usr/local/bin/python"
}
4 changes: 2 additions & 2 deletions containers/python-3-jupyter-pyspark/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ USER root
RUN pip install pylint

# Copy jupyter_notebook_config.py with token that matches settings
COPY .devcontainer/jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py
COPY jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py

# Copy default endpoint specific user settings overrides into container to specify Python path, token
COPY .devcontainer/settings.vscode.json /home/jovyan/.vscode-remote/data/User/settings.json
COPY settings.vscode.json /home/jovyan/.vscode-remote/data/User/settings.json

# Install git
RUN apt-get update && apt-get -y install git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ services:
jupyter:
build:
context: .
dockerfile: .devcontainer/Dockerfile
dockerfile: Dockerfile
ports:
- "8888:8888"
volumes:
- .:/notebook
- ..:/notebook

3 changes: 3 additions & 0 deletions containers/python-3/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

FROM python:3-slim

# Copy default endpoint specific user settings overrides into container to specify Python path
COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/User/settings.json

RUN pip install pylint

# Install git
Expand Down
3 changes: 3 additions & 0 deletions containers/python-3/.devcontainer/settings.vscode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/local/bin/python"
}

0 comments on commit 64bff0f

Please sign in to comment.