Skip to content

Instantly share code, notes, and snippets.

@phelewski
phelewski / Dockerfile
Last active March 9, 2020 12:57
Visual Studios Code Remote - Container Blog | Example Ruby Project Dockerfile
FROM ruby:2.5
RUN gem install bundler \
rubocop \
solargraph
@phelewski
phelewski / devcontainer.json
Last active May 20, 2021 15:18
Visual Studios Code Remote - Container Blog | Example Ruby Project devcontainer.json
{
"name": "Ruby Development",
"dockerFile": "Dockerfile",
"appPort": 9001,
"extensions": [
"rebornix.Ruby",
"castwide.solargraph",
"kaiwood.endwise",
"misogi.ruby-rubocop",
"groksrc.ruby",
@phelewski
phelewski / devcontainer.json
Created March 9, 2020 13:03
Visual Studios Code Remote - Container Blog | Example Ruby Project devcontainer.json Spaces & Tabs Partial
{
"settings": {
"[ruby]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
},
"[yaml]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
},
@phelewski
phelewski / devcontainer.json
Created March 9, 2020 13:04
Visual Studios Code Remote - Container Blog | Example Ruby Project devcontainer.json YAML Partial
{
"extensions": [
"redhat.vscode-yaml"
],
"settings": {
"yaml.format.singleQuote": true,
"yaml.customTags": [
"!And sequence",
"!Cidr sequence",
"!Equals sequence",
@phelewski
phelewski / devcontainer.json
Created March 9, 2020 13:05
Visual Studios Code Remote - Container Blog | Example Ruby Project devcontainer.json postCreateCommand Partial
{
"postCreateCommand": "bundle install"
}
@phelewski
phelewski / tree
Created March 10, 2020 19:56
Visual Studios Code Remote - Container Blog | Example Ruby Project tree
.
├── .devcontainer
│   ├── .devcontainer.json
│   └── Dockerfile
├── Gemfile
├── Gemfile.lock
├── LICENSE.md
├── README.md
├── bin
│   └── foo
@phelewski
phelewski / devcontainer.json
Created March 12, 2020 16:14
Visual Studios Code Remote - Container Blog | Example devcontainer.json
{
"name": "Ruby Development",
"dockerFile": "Dockerfile",
"appPort": 9001,
"extensions": [
"rebornix.Ruby"
],
"settings": {
"[ruby]": {
"editor.insertSpaces": true,
@phelewski
phelewski / devcontainer.json
Created May 12, 2020 14:31
Visual Studios Code Remote - Container Blog | remote.containers.workspaceMountConsistency
"remote.containers.workspaceMountConsistency": "consistent",
@phelewski
phelewski / Dockerfile
Created May 12, 2020 14:35
Visual Studios Code Remote - Container Blog | Example non-root User
ARG USERNAME=cfn_nag_dev
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID --shell /bin/bash -m $USERNAME
@phelewski
phelewski / Dockerfile
Created May 12, 2020 14:36
Visual Studios Code Remote - Container Blog | Example non-root User with sudo
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:/usr/sbin/foo > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME