Skip to content

Commit

Permalink
Add .devcontainer support (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbuker authored Apr 11, 2023
1 parent 35fc3d5 commit 080cf73
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Which Ruby version to use. You may need to use a more restrictive version,
# e.g. `3.0`
ARG VARIANT=3.0

# Pull Microsoft's ruby devcontainer base image
FROM mcr.microsoft.com/devcontainers/ruby:${VARIANT}

# Ensure we're running the latest bundler, as what ships with the Ruby image may
# not be current, and bundler will auto-downgrade to match the Gemfile.lock
RUN gem install bundler
29 changes: 29 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Ruby",
"build": {
"dockerfile": "Dockerfile"
},

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"rebornix.Ruby"
]
}
},

// Set the environment variables
// "runArgs": ["--env-file",".env"],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash .devcontainer/postcreate.sh",

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
4 changes: 4 additions & 0 deletions .devcontainer/postcreate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

bundle config set path vendor/bundle
bundle install --jobs=1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ doc

# bundler
.bundle
vendor

# jeweler generated
pkg
Expand Down

0 comments on commit 080cf73

Please sign in to comment.