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

Commit

Permalink
Add ptrace runArgs into samples, docker-in-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed May 8, 2019
1 parent 8b24df6 commit af6f09d
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 55 deletions.
24 changes: 17 additions & 7 deletions container-templates/docker-compose/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
{
// "See https://aka.ms/vscode-remote/devcontainer.json for format details."
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
"name": "Dev Container Definition Template - Docker Compose",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
"dockerComposeFile": "docker-compose.yml",
"service": "your-service-name-here",

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "your-service-name-here",

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a volume mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"extensions": [
"mutantdino.resourcemonitor"
]
}

// Add any extensions you want auto-installed here.
"extensions": [],

// Update the value of this line like to 'none' if you want to keep your containers running after VS Code shuts down.
"shutdownAction": "stopCompose"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ services:
# Using a Dockerfile is optional, but included for completeness.
build:
context: .
dockerfile: .devcontainer/Dockerfile
dockerfile: Dockerfile

# Application port(s) to expose
ports:
- "3000:3000"
# Uncomment to expose one or more ports
# ports:
# - "3000:3000"

volumes:
# This is where VS Code should expect to find your project's source code
Expand All @@ -23,6 +23,12 @@ services:
# This lets you avoid setting up Git again in the container
- ~/.gitconfig:/root/.gitconfig

# Uncomment the next four lines if you will use ptrace-based debuggers like C++, Go, and Rust
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined

# Overrides default command so things don't shut down after the process ends - useful for debugging
command: sleep infinity

32 changes: 23 additions & 9 deletions container-templates/dockerfile/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
{
// "See https://aka.ms/vscode-remote/devcontainer.json for format details."
"name": "Dev Container Definition Template - Dockerfile",
"dockerFile": "Dockerfile",
"appPort": 3000,
"extensions": [
"mutantdino.resourcemonitor"
],
"runArgs": []
}
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
"name": "Dev Container Definition Template - Dockerfile",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "Dockerfile",

// Use the optional 'appPort' property to expose ports not already in your Dockerfile
"appPort": [],

// Add any extensions you want auto-installed here.
"extensions": [],

// The optional 'runArgs' property can be used to specify additional runtime arguments.
"runArgs": [
// Uncomment the next line if you plan to install the Docker CLI. See the Docker in Docker definition for details
// "-v","/var/run/docker.sock:/var/run/docker.sock",

// Uncomment the next three lines if you will be using a ptrace-based debuggers like C++, Go, and Rust.
// "--cap-add=SYS_PTRACE",
// "--security-opt",
/// "seccomp=unconfined"
]
}
29 changes: 22 additions & 7 deletions container-templates/image/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
{
// "See https://aka.ms/vscode-remote/devcontainer.json for format details."
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
"name": "Dev Container Definition Template - Container Image",

// Update the 'image' property with your Docker image name.
"image": "ubuntu:bionic",
"appPort": 3000,
"extensions": [
"mutantdino.resourcemonitor"
],
"runArgs": []
}

// Use the optional 'appPort' property to expose ports not already in your Dockerfile
"appPort": [],

// Add any extensions you want auto-installed here.
"extensions": [],

// The optional 'runArgs' property can be used to specify additional runtime arguments.
"runArgs": [
// Uncomment the next line if you plan to install the Docker CLI. See the Docker in Docker definition for details
// "-v","/var/run/docker.sock:/var/run/docker.sock",

// Uncomment the next three lines if you will be using a ptrace-based debuggers like C++, Go, and Rust.
// "--cap-add=SYS_PTRACE",
// "--security-opt",
/// "seccomp=unconfined"
]

}
11 changes: 10 additions & 1 deletion containers/debian-9-git/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"name": "Debian 9 & Git",
"dockerFile": "Dockerfile",
"appPort": []
"appPort": [],
"runArgs": [
// Uncomment the next line if you plan to install the Docker CLI. See the Docker in Docker definition for details
// "-v","/var/run/docker.sock:/var/run/docker.sock",

// Uncomment the next three lines if you will be using a ptrace-based debuggers like C++, Go, and Rust.
// "--cap-add=SYS_PTRACE",
// "--security-opt",
/// "seccomp=unconfined"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
// "Add any extensions you want auto-installed here."
"extensions": [],

// "Remove this line if you want to keep your containers running after VS Code shuts down."
// "Update the value of this line like to 'none' if you want to keep your containers running after VS Code shuts down."
"shutdownAction": "stopCompose"

// "Other notes:"
// "- The 'appPorts' property is not supported in the Docker Compose case. Add the ports into"
// " the docker-compose.yml in the .devcontainer folder instead."
// "- The 'runArgs' property is also not supported."
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ services:
# This lets you avoid setting up Git again in the container
- ~/.gitconfig:/root/.gitconfig

# 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.
- /var/run/docker.sock:/var/run/docker.sock
# Uncomment the line below if you plan to install the Docker CLI. See the docker-in-docker-compose definition for details.
# - /var/run/docker.sock:/var/run/docker.sock

# Uncomment the next four lines if you will use ptrace-based debuggers like C++, Go, and Rust
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined

# Overrides default command so things don't shut down after the process ends - useful for debugging
command: sleep infinity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
{
// "See https://aka.ms/vscode-remote/devcontainer.json for format details."
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
"name": "Existing Dockerfile",

// "Sets the run context to one level up instead of the .devcontainer folder.
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",

// "Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename."
"dockerFile": "Dockerfile",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "Dockerfile",

// "Use the optional 'appPort' property to expose ports not already in your Dockerfile"
// Use the optional 'appPort' property to expose ports not already in your Dockerfile
"appPort": [],

// "Add any extensions you want auto-installed here."
// Add any extensions you want auto-installed here.
"extensions": [],

// "The optional 'runArgs' property can be used to specify Docker CLI arguments to use when the container."
// "is started. If you install the Docker CE CLI in your container, the runArgs list below will lets you interact"
// "with your host's Docker service from inside the container. See the docker-in-docker and docker-in-docker"
// "definitions for details."
"runArgs": ["-v","/var/run/docker.sock:/var/run/docker.sock"]
// The optional 'runArgs' property can be used to specify additional runtime arguments.
"runArgs": [
// Uncomment the next line if you plan to install the Docker CLI. See the Docker in Docker definition for details
// "-v","/var/run/docker.sock:/var/run/docker.sock",

// Uncomment the next three lines if you will be using a ptrace-based debuggers like C++, Go, and Rust.
// "--cap-add=SYS_PTRACE",
// "--security-opt",
/// "seccomp=unconfined"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@ services:
build:
context: .
dockerfile: Dockerfile

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

# This lets you avoid setting up Git again in the container
- ~/.gitconfig:/root/.gitconfig

# 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.
# Forwards the Docker socket from one side ot the other
- /var/run/docker.sock:/var/run/docker.sock


# Uncomment the next four lines if you will use ptrace-based debuggers like C++, Go, and Rust
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined

# Overrides default command so things don't shut down after the process ends - useful for debugging
command: sleep infinity

9 changes: 8 additions & 1 deletion containers/docker-in-docker/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@
"extensions": [
"peterjausovec.vscode-docker"
],
"runArgs": ["-v","/var/run/docker.sock:/var/run/docker.sock"]
"runArgs": [
"-v","/var/run/docker.sock:/var/run/docker.sock",

// Uncomment the next three lines if you will be using a ptrace-based debuggers like C++, Go, and Rust.
// "--cap-add=SYS_PTRACE",
// "--security-opt",
/// "seccomp=unconfined"
]
}
11 changes: 9 additions & 2 deletions containers/kubernetes-helm/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
"peterjausovec.vscode-docker",
"ms-kubernetes-tools.vscode-kubernetes-tools"
],
"runArgs": ["-e", "SYNC_LOCALHOST_KUBECONFIG=true",
"runArgs": [
"-e", "SYNC_LOCALHOST_KUBECONFIG=true",
"-v", "/var/run/docker.sock:/var/run/docker.sock",
"-v", "${env:HOME}${env:USERPROFILE}/.kube:/root/.kube-localhost"]
"-v", "${env:HOME}${env:USERPROFILE}/.kube:/root/.kube-localhost",

// Uncomment the next three lines if you will be using a ptrace-based debuggers like C++, Go, and Rust.
// "--cap-add=SYS_PTRACE",
// "--security-opt",
/// "seccomp=unconfined"
]
}
11 changes: 10 additions & 1 deletion containers/ubuntu-18.04-git/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"name": "Ubuntu 18.04 & Git",
"dockerFile": "Dockerfile",
"appPort": []
"appPort": [],
"runArgs": [
// Uncomment the next line if you plan to install the Docker CLI. See the Docker in Docker definition for details
// "-v","/var/run/docker.sock:/var/run/docker.sock",

// Uncomment the next three lines if you will be using a ptrace-based debuggers like C++, Go, and Rust.
// "--cap-add=SYS_PTRACE",
// "--security-opt",
/// "seccomp=unconfined"
]
}

0 comments on commit af6f09d

Please sign in to comment.