Skip to content

🧑‍💻 devcontainer for debugging with Ruby 2.5 #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .devcontainer/apt-install/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Apt Install Packages",
"id": "apt-install",
"version": "1.0.0",
"description": "More packages are needed",
"install": {
"script": "install.sh"
}
}
5 changes: 5 additions & 0 deletions .devcontainer/apt-install/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
apt-get update -y
apt-get install -y direnv default-jdk git zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev
# Adds the direnv setup script to ~/.bashrc file (at the end)
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
28 changes: 28 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
{
"name": "Ruby 2.5 on Debian",
"image": "ruby:2.5-slim-buster", // Specify the Ruby 2.5 image
"postCreateCommand": "RUBYGEMS_VERSION=3.3.27\ngem install rubygems-update -v ${RUBYGEMS_VERSION} > /dev/null 2>&1\nupdate_rubygems > /dev/null 2>&1\n", // Optional: Run this command after the container is created

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"./apt-install": {}
},

// 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": "ruby --version",

// Configure tool-specific properties.
"customizations" : {
"jetbrains" : {
"backend" : "RubyMine"
}
},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}