Skip to content

Instantly share code, notes, and snippets.

@phelewski
phelewski / Dockerfile
Created May 12, 2020
Visual Studios Code Remote - Container Blog | Example vscode-remote custom image
View Dockerfile
FROM stelligent/vscode-remote-cfn_nag:latest
@phelewski
phelewski / GitHub-workflow.yaml
Created May 12, 2020
Visual Studios Code Remote - Container Blog | Example Docker Hub Publishing GitHub Workflow Action
View GitHub-workflow.yaml
name: VS Code DockerHub Build & Push
on:
push:
branches:
- 'master'
paths:
- '.devcontainer/build/Dockerfile'
jobs:
@phelewski
phelewski / devcontainer.json
Created May 12, 2020
Visual Studios Code Remote - Container Blog | Enable Signing Git Commits With GPG
View devcontainer.json
"runArgs": [
// SSH
"-v", "${localEnv:HOME}/.ssh:/home/project_user_name/.ssh:ro",
// GPG
"-v", "${localEnv:HOME}/.gnupg/private-keys-v1.d:/home/project_user_name/.gnupg/private-keys-v1.d:ro",
"-v", "${localEnv:HOME}/.gnupg/pubring.kbx:/home/project_user_name/.gnupg/pubring.kbx:ro",
"-v", "${localEnv:HOME}/.gnupg/trustdb.gpg:/home/project_user_name/.gnupg/trustdb.gpg:ro"
],
@phelewski
phelewski / Dockerfile
Created May 12, 2020
Visual Studios Code Remote - Container Blog | Enable GPG
View Dockerfile
RUN apt-get install -y gnupg-agent
RUN echo 'export GPG_TTY="$(tty)"' >> /home/$USERNAME/.bashrc \
&& mkdir /home/$USERNAME/.gnupg \
&& chown -R $USERNAME /home/$USERNAME/.gnupg
@phelewski
phelewski / Dockerfile
Created May 12, 2020
Visual Studios Code Remote - Container Blog | Install Docker CLI
View Dockerfile
RUN apt-get install -y apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common \
lsb-release \
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y docker-ce-cli
@phelewski
phelewski / devcontainer.json
Created May 12, 2020
Visual Studios Code Remote - Container Blog | Bind Docker Socket
View devcontainer.json
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
@phelewski
phelewski / devcontainer.json
Created May 12, 2020
Visual Studios Code Remote - Container Blog | Example Container ENV Variables
View devcontainer.json
"containerEnv": {
"CUSTOM_VAR": "custom-variable-value",
"DYNAMIC_VAR": "${localEnv:LOCAL_VARIABLE}"
},
@phelewski
phelewski / devcontainer.json
Created May 12, 2020
Visual Studios Code Remote - Container Blog | Example runArgs Volume
View devcontainer.json
"runArgs": [
"-v", "/local/linux/directory:/container/directory"
],
@phelewski
phelewski / devcontainer.json
Created May 12, 2020
Visual Studios Code Remote - Container Blog | Example Dynamic Mount
View devcontainer.json
"mounts": [
"source=${localEnv:HOME},target=/home,type=bind"
],
@phelewski
phelewski / devcontainer.json
Created May 12, 2020
Visual Studios Code Remote - Container Blog | Example Static Mount
View devcontainer.json
"mounts": [
"source=/LOCAL/PATH/GOES/HERE,target=/CONTAINER/PATH/GOES/HERE,type=bind"
],