Skip to content

Instantly share code, notes, and snippets.

@phelewski
phelewski / Dockerfile
Created May 12, 2020 14:58
Visual Studios Code Remote - Container Blog | Example vscode-remote custom image
FROM stelligent/vscode-remote-cfn_nag:latest
@phelewski
phelewski / GitHub-workflow.yaml
Created May 12, 2020 14:56
Visual Studios Code Remote - Container Blog | Example Docker Hub Publishing GitHub Workflow Action
name: VS Code DockerHub Build & Push
on:
push:
branches:
- 'master'
paths:
- '.devcontainer/build/Dockerfile'
jobs:
@phelewski
phelewski / devcontainer.json
Created May 12, 2020 14:53
Visual Studios Code Remote - Container Blog | Enable Signing Git Commits With GPG
"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 14:49
Visual Studios Code Remote - Container Blog | Enable GPG
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 14:48
Visual Studios Code Remote - Container Blog | Install Docker CLI
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 14:47
Visual Studios Code Remote - Container Blog | Bind Docker Socket
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
@phelewski
phelewski / devcontainer.json
Created May 12, 2020 14:46
Visual Studios Code Remote - Container Blog | Example Container ENV Variables
"containerEnv": {
"CUSTOM_VAR": "custom-variable-value",
"DYNAMIC_VAR": "${localEnv:LOCAL_VARIABLE}"
},
@phelewski
phelewski / devcontainer.json
Created May 12, 2020 14:44
Visual Studios Code Remote - Container Blog | Example runArgs Volume
"runArgs": [
"-v", "/local/linux/directory:/container/directory"
],
@phelewski
phelewski / devcontainer.json
Created May 12, 2020 14:43
Visual Studios Code Remote - Container Blog | Example Dynamic Mount
"mounts": [
"source=${localEnv:HOME},target=/home,type=bind"
],
@phelewski
phelewski / devcontainer.json
Created May 12, 2020 14:41
Visual Studios Code Remote - Container Blog | Example Static Mount
"mounts": [
"source=/LOCAL/PATH/GOES/HERE,target=/CONTAINER/PATH/GOES/HERE,type=bind"
],