Refresh Ruby definitions with latest patterns
This commit is contained in:
Родитель
84ec37dff9
Коммит
4ce3af7d9d
|
@ -2,6 +2,8 @@
|
|||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Update the VARIANT arg in devcontainer.json to pick a .NET Core version: 3.1-bionic, 2.1-bionic
|
||||
ARG VARIANT="3.1-bionic"
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:${VARIANT}
|
||||
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
FROM debian:10
|
||||
|
||||
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
|
||||
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
|
||||
# will be updated to match your local UID/GID (when using the dockerFile property).
|
||||
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
|
||||
ARG USERNAME=vscode
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
# Configure apt and install packages
|
||||
RUN apt-get update \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
|
||||
#
|
||||
# Install vim, git, process tools, lsb-release
|
||||
&& apt-get install -y \
|
||||
vim \
|
||||
git \
|
||||
openssh-client \
|
||||
less \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsb-release \
|
||||
#
|
||||
# Install ruby
|
||||
&& apt-get install -y \
|
||||
ruby \
|
||||
ruby-dev \
|
||||
build-essential \
|
||||
libsqlite3-dev \
|
||||
zlib1g-dev \
|
||||
libxml2 \
|
||||
#
|
||||
# Install nodejs
|
||||
&& apt-get install -y nodejs \
|
||||
#
|
||||
# Install yarn
|
||||
&& apt-get install -y curl apt-transport-https lsb-release \
|
||||
&& curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \
|
||||
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
|
||||
&& apt-get update \
|
||||
&& apt-get -y install --no-install-recommends yarn \
|
||||
#
|
||||
# Install debug tools
|
||||
&& gem install \
|
||||
rake \
|
||||
ruby-debug-ide \
|
||||
debase \
|
||||
#
|
||||
# Install sinatra MVC components
|
||||
&& gem install \
|
||||
rails \
|
||||
webdrivers \
|
||||
#
|
||||
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
|
||||
&& groupadd --gid $USER_GID $USERNAME \
|
||||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
|
||||
# [Optional] Add sudo support for the non-root user
|
||||
&& apt-get install -y sudo \
|
||||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
|
||||
&& chmod 0440 /etc/sudoers.d/$USERNAME \
|
||||
#
|
||||
# Clean up
|
||||
&& apt-get autoremove -y \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"name": "Ruby 2 Rails",
|
||||
"dockerFile": "Dockerfile",
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"rebornix.Ruby"
|
||||
]
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [3000],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "cd ${input:projectName} && bundle install",
|
||||
|
||||
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
|
||||
// "remoteUser": "vscode"
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
FROM debian:10
|
||||
|
||||
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
|
||||
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
|
||||
# will be updated to match your local UID/GID (when using the dockerFile property).
|
||||
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
|
||||
ARG USERNAME=vscode
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
# Configure apt and install packages
|
||||
RUN apt-get update \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
|
||||
#
|
||||
# Install vim, git, process tools, lsb-release
|
||||
&& apt-get install -y \
|
||||
vim \
|
||||
git \
|
||||
openssh-client \
|
||||
less \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsb-release \
|
||||
#
|
||||
# Install ruby
|
||||
&& apt-get install -y \
|
||||
ruby \
|
||||
ruby-dev \
|
||||
build-essential \
|
||||
libsqlite3-dev \
|
||||
#
|
||||
# Install debug tools
|
||||
&& gem install \
|
||||
rake \
|
||||
ruby-debug-ide \
|
||||
debase \
|
||||
#
|
||||
# Install sinatra MVC components
|
||||
&& gem install \
|
||||
sinatra \
|
||||
sinatra-reloader \
|
||||
thin \
|
||||
data_mapper \
|
||||
dm-sqlite-adapter \
|
||||
#
|
||||
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
|
||||
&& groupadd --gid $USER_GID $USERNAME \
|
||||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
|
||||
# [Optional] Add sudo support for the non-root user
|
||||
&& apt-get install -y sudo \
|
||||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
|
||||
&& chmod 0440 /etc/sudoers.d/$USERNAME \
|
||||
#
|
||||
# Clean up
|
||||
&& apt-get autoremove -y \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
|
@ -1,39 +0,0 @@
|
|||
#-------------------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
FROM ruby:2
|
||||
|
||||
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
|
||||
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
|
||||
# will be updated to match your local UID/GID (when using the dockerFile property).
|
||||
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
|
||||
ARG USERNAME=vscode
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
# Configure apt and install packages
|
||||
RUN apt-get update \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
|
||||
# Verify git, process tools installed
|
||||
&& apt-get -y install git openssh-client less iproute2 procps lsb-release \
|
||||
#
|
||||
# Install ruby-debug-ide and debase
|
||||
&& gem install ruby-debug-ide \
|
||||
&& gem install debase \
|
||||
#
|
||||
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
|
||||
&& groupadd --gid $USER_GID $USERNAME \
|
||||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
|
||||
# [Optional] Add sudo support for the non-root user
|
||||
&& apt-get install -y sudo \
|
||||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
|
||||
&& chmod 0440 /etc/sudoers.d/$USERNAME \
|
||||
#
|
||||
# Clean up
|
||||
&& apt-get autoremove -y \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
#-------------------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Update the VARIANT arg in devcontainer.json to pick a Ruby version: 2, 2.7, 2.6, 2.5
|
||||
ARG VARIANT=2
|
||||
FROM ruby:${VARIANT}
|
||||
|
||||
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
|
||||
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
|
||||
# will be updated to match your local UID/GID (when using the dockerFile property).
|
||||
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
|
||||
ARG USERNAME=vscode
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
# Options for common package install script
|
||||
ARG INSTALL_ZSH="true"
|
||||
ARG UPGRADE_PACKAGES="true"
|
||||
ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh"
|
||||
ARG COMMON_SCRIPT_SHA="dev-mode"
|
||||
|
||||
# Settings for installing Node.js.
|
||||
ARG NODE_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/node-debian.sh"
|
||||
ARG NODE_SCRIPT_SHA="dev-mode"
|
||||
ARG NODE_VERSION="lts/*"
|
||||
ENV NVM_DIR=/usr/local/share/nvm
|
||||
# Have nvm create a "current" symlink and add to path to work around https://github.com/microsoft/vscode-remote-release/issues/3224
|
||||
ENV NVM_SYMLINK_CURRENT=true
|
||||
ENV PATH=${NVM_DIR}/current/bin:${PATH}
|
||||
|
||||
# Configure apt and install packages
|
||||
RUN apt-get update \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
#
|
||||
# Verify git, common tools / libs installed, add/modify non-root user, optionally install zsh
|
||||
&& apt-get -y install --no-install-recommends curl ca-certificates 2>&1 \
|
||||
&& curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh \
|
||||
&& ([ "${COMMON_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/common-setup.sh" | sha256sum -c -)) \
|
||||
&& /bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
|
||||
#
|
||||
# Install Node.js for front end development
|
||||
&& curl -sSL ${NODE_SCRIPT_SOURCE} -o /tmp/node-setup.sh \
|
||||
&& ([ "${NODE_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/node-setup.sh" | sha256sum -c -)) \
|
||||
&& /bin/bash /tmp/node-setup.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \
|
||||
#
|
||||
# Install gems and dependencies
|
||||
&& apt-get -y install build-essential libsqlite3-dev zlib1g-dev libxml2 \
|
||||
&& gem install \
|
||||
rake \
|
||||
ruby-debug-ide \
|
||||
debase \
|
||||
rails \
|
||||
webdrivers \
|
||||
#
|
||||
# Clean up
|
||||
&& apt-get autoremove -y \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/common-setup.sh /tmp/node-setup.sh
|
||||
|
||||
# ** [Optional] Uncomment this section to install additional OS packages. **
|
||||
#
|
||||
# RUN apt-get update \
|
||||
# && export DEBIAN_FRONTEND=noninteractive \
|
||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
||||
|
||||
# ** [Optional] Uncomment this section to install additional Ruby gems packages. **
|
||||
#
|
||||
# RUN gem install <your gem names here>
|
||||
|
|
@ -1,6 +1,16 @@
|
|||
{
|
||||
"name": "Ruby 2",
|
||||
"dockerFile": "Dockerfile",
|
||||
"name": "Ruby on Rails",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
// Update 'VARIANT' to pick a Ruby version. Rebuild the container if
|
||||
// it already exists to update. Example variants: 2, 2.7, 2.6, 2.5
|
||||
"VARIANT": "2",
|
||||
// Options
|
||||
"NODE_VERSION": "lts/*",
|
||||
"UPGRADE_PACKAGES": "false"
|
||||
}
|
||||
},
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
|
@ -1,8 +1,8 @@
|
|||
# Ruby 2 Rails 5
|
||||
# Ruby on Rails
|
||||
|
||||
## Summary
|
||||
|
||||
*Develop Ruby on Rails 5 applications, includes everything you need to get up and running.*
|
||||
*Develop Ruby on Rails applications, includes everything you need to get up and running.*
|
||||
|
||||
| Metadata | Value |
|
||||
|----------|-------|
|
||||
|
@ -14,18 +14,33 @@
|
|||
|
||||
## Using this definition with an existing folder
|
||||
|
||||
This definition does not require any special steps to use. Just follow these steps:
|
||||
While this definition should work unmodified, you can select the version of Ruby the container uses by updating the `VARIANT` arg in the included `devcontainer.json` (and rebuilding if you've already created the container).
|
||||
|
||||
```json
|
||||
"args": { "VARIANT": "2.7" }
|
||||
```
|
||||
|
||||
This container also includes Node.js. You can change the version of Node.js by updating the `args` property in `.devcontainer/devcontainer.json`.
|
||||
|
||||
```json
|
||||
"args": {
|
||||
"VARIANT": "2",
|
||||
"NODE_VERSION": "10",
|
||||
}
|
||||
```
|
||||
|
||||
### Adding the definition to your folder
|
||||
|
||||
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
|
||||
|
||||
2. To start then:
|
||||
1. Start VS Code and open your project folder.
|
||||
2. Press <kbd>F1</kbd> select and **Remote-Containers: Add Development Container Configuration Files...** from the command palette.
|
||||
3. Select the Ruby 2 rails 5 definition.
|
||||
3. Select the Ruby on Rails definition.
|
||||
|
||||
3. To use latest-and-greatest copy of this definition from the repository:
|
||||
1. Clone this repository.
|
||||
2. Copy the contents of `.devcontainer` and `.vscode` folders under `containers/ruby-2-rails-5/` to the root of your project folder.
|
||||
2. Copy the contents of `.devcontainer` and `.vscode` folders under `containers/ruby-rails/` to the root of your project folder.
|
||||
3. Start VS Code and open your project folder.
|
||||
|
||||
4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.
|
||||
|
@ -39,10 +54,10 @@ This definition includes some test code that will help you verify it is working
|
|||
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
|
||||
2. Clone this repository.
|
||||
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
|
||||
4. Select the `containers/ruby-2-rails-5` folder.
|
||||
4. Select the `containers/ruby-rails` folder.
|
||||
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
|
||||
6. You should see "* Listening on tcp://0.0.0.0:3000" in the Debug Console.
|
||||
7. Press <kbd>F1</kbd>. Select **Remote-Containers: Forward Port from Container...** then choose **Forward 3000**.
|
||||
7. Press <kbd>F1</kbd>. Select **Forward a Port** then choose **Forward 3000**.
|
||||
8. By browsing http://localhost:3000/ you should see "Yay! You’re on Rails!".
|
||||
9. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
#-------------------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Update the VARIANT arg in devcontainer.json to pick a Ruby version: 2, 2.7, 2.6, 2.5
|
||||
ARG VARIANT=2
|
||||
FROM ruby:${VARIANT}
|
||||
|
||||
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
|
||||
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
|
||||
# will be updated to match your local UID/GID (when using the dockerFile property).
|
||||
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
|
||||
ARG USERNAME=vscode
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
# Options for common package install script
|
||||
ARG INSTALL_ZSH="true"
|
||||
ARG UPGRADE_PACKAGES="true"
|
||||
ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh"
|
||||
ARG COMMON_SCRIPT_SHA="dev-mode"
|
||||
|
||||
# [Optional] Settings for installing Node.js.
|
||||
ARG INSTALL_NODE="true"
|
||||
ARG NODE_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/node-debian.sh"
|
||||
ARG NODE_SCRIPT_SHA="dev-mode"
|
||||
ARG NODE_VERSION="lts/*"
|
||||
ENV NVM_DIR=/usr/local/share/nvm
|
||||
# Have nvm create a "current" symlink and add to path to work around https://github.com/microsoft/vscode-remote-release/issues/3224
|
||||
ENV NVM_SYMLINK_CURRENT=true
|
||||
ENV PATH=${NVM_DIR}/current/bin:${PATH}
|
||||
|
||||
# Configure apt and install packages
|
||||
RUN apt-get update \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
#
|
||||
# Verify git, common tools / libs installed, add/modify non-root user, optionally install zsh
|
||||
&& apt-get -y install --no-install-recommends curl ca-certificates 2>&1 \
|
||||
&& curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh \
|
||||
&& ([ "${COMMON_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/common-setup.sh" | sha256sum -c -)) \
|
||||
&& /bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
|
||||
#
|
||||
# [Optional] Install Node.js for use with web applications
|
||||
&& if [ "$INSTALL_NODE" = "true" ]; then \
|
||||
curl -sSL ${NODE_SCRIPT_SOURCE} -o /tmp/node-setup.sh \
|
||||
&& ([ "${NODE_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/node-setup.sh" | sha256sum -c -)) \
|
||||
&& /bin/bash /tmp/node-setup.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}"; \
|
||||
fi \
|
||||
#
|
||||
# Install Ruby tools, Sinatra, and dependencies
|
||||
&& apt-get install -y build-essential libsqlite3-dev \
|
||||
&& gem install \
|
||||
rake \
|
||||
ruby-debug-ide \
|
||||
debase \
|
||||
sinatra \
|
||||
sinatra-reloader \
|
||||
thin \
|
||||
data_mapper \
|
||||
dm-sqlite-adapter \
|
||||
#
|
||||
# Clean up
|
||||
&& apt-get autoremove -y \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/common-setup.sh /tmp/node-setup.sh
|
||||
|
||||
# ** [Optional] Uncomment this section to install additional OS packages. **
|
||||
#
|
||||
# RUN apt-get update \
|
||||
# && export DEBIAN_FRONTEND=noninteractive \
|
||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
||||
|
||||
# ** [Optional] Uncomment this section to install additional Ruby gems packages. **
|
||||
#
|
||||
# RUN gem install <your gem names here>
|
|
@ -1,6 +1,17 @@
|
|||
{
|
||||
"name": "Ruby 2 Sinatra",
|
||||
"dockerFile": "Dockerfile",
|
||||
"name": "Ruby & Sinatra",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
// Update 'VARIANT' to pick a Ruby version. Rebuild the container if
|
||||
// it already exists to update. Example variants: 2, 2.7, 2.6, 2.5
|
||||
"VARIANT": "2",
|
||||
// Options
|
||||
"INSTALL_NODE": "false",
|
||||
"NODE_VERSION": "lts/*",
|
||||
"UPGRADE_PACKAGES": "false"
|
||||
}
|
||||
},
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
|
@ -1,8 +1,8 @@
|
|||
# Ruby 2 Sinatra
|
||||
# Ruby & Sinatra
|
||||
|
||||
## Summary
|
||||
|
||||
*Develop Ruby 2 Sinatra applications. Includes everything you need to get up and running.*
|
||||
*Develop Ruby & Sinatra applications. Includes everything you need to get up and running.*
|
||||
|
||||
| Metadata | Value |
|
||||
|----------|-------|
|
||||
|
@ -14,7 +14,25 @@
|
|||
|
||||
## Using this definition with an existing folder
|
||||
|
||||
This definition does not require any special steps to use. Just follow these steps:
|
||||
While this definition should work unmodified, you can select the version of Ruby the container uses by updating the `VARIANT` arg in the included `devcontainer.json` (and rebuilding if you've already created the container).
|
||||
|
||||
```json
|
||||
"args": { "VARIANT": "2.7" }
|
||||
```
|
||||
|
||||
### Installing Node.js
|
||||
|
||||
Given how frequently Ruby-based web applications use Node.js for front end code, this container also includes Node.js. You can change the version of Node.js installed or disable its installation by updating the `args` property in `.devcontainer/devcontainer.json`.
|
||||
|
||||
```json
|
||||
"args": {
|
||||
"VARIANT": "2",
|
||||
"INSTALL_NODE": "true",
|
||||
"NODE_VERSION": "10",
|
||||
}
|
||||
```
|
||||
|
||||
### Adding the definition to your folder
|
||||
|
||||
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
|
||||
|
||||
|
@ -25,7 +43,7 @@ This definition does not require any special steps to use. Just follow these ste
|
|||
|
||||
3. To use latest-and-greatest copy of this definition from the repository:
|
||||
1. Clone this repository.
|
||||
2. Copy the contents of `containers/ruby-2-sinatra/.devcontainer` to the root of your project folder.
|
||||
2. Copy the contents of `containers/ruby-sinatra/.devcontainer` to the root of your project folder.
|
||||
3. Start VS Code and open your project folder.
|
||||
|
||||
4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.
|
||||
|
@ -39,9 +57,9 @@ This definition includes some test code that will help you verify it is working
|
|||
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
|
||||
2. Clone this repository.
|
||||
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
|
||||
4. Select the `containers/ruby-2-sinatra` folder.
|
||||
4. Select the `containers/ruby-sinatra` folder.
|
||||
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
|
||||
6. You should see "Try http://localhost:4567/ in the browser!" in the Debug Console. Press <kbd>F1</kbd>. Select **Remote-Containers: Forward Porrt From Container...** then choose **Forward 4567**, and by browsing http://localhost:4567/ you should see "Hello from Sinatra!".
|
||||
6. You should see "Try http://localhost:4567/ in the browser!" in the Debug Console. Press <kbd>F1</kbd>. Select **Forward a Port** then choose **Forward 4567**, and by browsing http://localhost:4567/ you should see "Hello from Sinatra!".
|
||||
7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.
|
||||
|
||||
## License
|
|
@ -0,0 +1,68 @@
|
|||
#-------------------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Update the VARIANT arg in devcontainer.json to pick a Ruby version: 2, 2.7, 2.6, 2.5
|
||||
ARG VARIANT=2
|
||||
FROM ruby:${VARIANT}
|
||||
|
||||
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
|
||||
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
|
||||
# will be updated to match your local UID/GID (when using the dockerFile property).
|
||||
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
|
||||
ARG USERNAME=vscode
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
# Options for common package install script
|
||||
ARG INSTALL_ZSH="true"
|
||||
ARG UPGRADE_PACKAGES="true"
|
||||
ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh"
|
||||
ARG COMMON_SCRIPT_SHA="dev-mode"
|
||||
|
||||
# [Optional] Settings for installing Node.js.
|
||||
ARG INSTALL_NODE="true"
|
||||
ARG NODE_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/node-debian.sh"
|
||||
ARG NODE_SCRIPT_SHA="dev-mode"
|
||||
ARG NODE_VERSION="lts/*"
|
||||
ENV NVM_DIR=/usr/local/share/nvm
|
||||
# Have nvm create a "current" symlink and add to path to work around https://github.com/microsoft/vscode-remote-release/issues/3224
|
||||
ENV NVM_SYMLINK_CURRENT=true
|
||||
ENV PATH=${NVM_DIR}/current/bin:${PATH}
|
||||
|
||||
# Configure apt and install packages
|
||||
RUN apt-get update \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
#
|
||||
# Verify git, common tools / libs installed, add/modify non-root user, optionally install zsh
|
||||
&& apt-get -y install --no-install-recommends curl ca-certificates 2>&1 \
|
||||
&& curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh \
|
||||
&& ([ "${COMMON_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/common-setup.sh" | sha256sum -c -)) \
|
||||
&& /bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
|
||||
#
|
||||
# [Optional] Install Node.js for use with web applications
|
||||
&& if [ "$INSTALL_NODE" = "true" ]; then \
|
||||
curl -sSL ${NODE_SCRIPT_SOURCE} -o /tmp/node-setup.sh \
|
||||
&& ([ "${NODE_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/node-setup.sh" | sha256sum -c -)) \
|
||||
&& /bin/bash /tmp/node-setup.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}"; \
|
||||
fi \
|
||||
#
|
||||
# Install rake, ruby-debug-ide, and debase, and dependencies
|
||||
&& apt-get install -y build-essential \
|
||||
&& gem install rake ruby-debug-ide debase \
|
||||
#
|
||||
# Clean up
|
||||
&& apt-get autoremove -y \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/common-setup.sh /tmp/node-setup.sh
|
||||
|
||||
# ** [Optional] Uncomment this section to install additional OS packages. **
|
||||
#
|
||||
# RUN apt-get update \
|
||||
# && export DEBIAN_FRONTEND=noninteractive \
|
||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
||||
|
||||
# ** [Optional] Uncomment this section to install additional Ruby gems packages. **
|
||||
#
|
||||
# RUN gem install <your gem names here>
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"name": "Ruby",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
// Update 'VARIANT' to pick a Ruby version. Rebuild the container if
|
||||
// it already exists to update. Example variants: 2, 2.7, 2.6, 2.5
|
||||
"VARIANT": "2",
|
||||
// Options
|
||||
"INSTALL_NODE": "false",
|
||||
"NODE_VERSION": "lts/*",
|
||||
"UPGRADE_PACKAGES": "false"
|
||||
}
|
||||
},
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"rebornix.Ruby"
|
||||
]
|
||||
|
||||
// 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",
|
||||
|
||||
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
|
||||
// "remoteUser": "vscode"
|
||||
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
# Ruby 2
|
||||
# Ruby
|
||||
|
||||
## Summary
|
||||
|
||||
*Develop Ruby 2 based applications. includes everything you need to get up and running.*
|
||||
*Develop Ruby based applications. includes everything you need to get up and running.*
|
||||
|
||||
| Metadata | Value |
|
||||
|----------|-------|
|
||||
|
@ -14,18 +14,36 @@
|
|||
|
||||
## Using this definition with an existing folder
|
||||
|
||||
This definition does not require any special steps to use. Just follow these steps:
|
||||
While this definition should work unmodified, you can select the version of Ruby the container uses by updating the `VARIANT` arg in the included `devcontainer.json` (and rebuilding if you've already created the container).
|
||||
|
||||
```json
|
||||
"args": { "VARIANT": "2.7" }
|
||||
```
|
||||
|
||||
### Installing Node.js
|
||||
|
||||
Given how frequently Ruby-based web applications use Node.js for front end code, this container also includes Node.js. You can change the version of Node.js installed or disable its installation by updating the `args` property in `.devcontainer/devcontainer.json`.
|
||||
|
||||
```json
|
||||
"args": {
|
||||
"VARIANT": "2",
|
||||
"INSTALL_NODE": "true",
|
||||
"NODE_VERSION": "10",
|
||||
}
|
||||
```
|
||||
|
||||
### Adding the definition to your folder
|
||||
|
||||
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
|
||||
|
||||
2. To use VS Code's copy of this definition:
|
||||
1. Start VS Code and open your project folder.
|
||||
2. Press <kbd>F1</kbd> select and **Remote-Containers: Add Development Container Configuration Files...** from the command palette.
|
||||
3. Select the Ruby 2 definition.
|
||||
3. Select the Ruby definition.
|
||||
|
||||
3. To use latest-and-greatest copy of this definition from the repository:
|
||||
1. Clone this repository.
|
||||
2. Copy the contents of `containers/ruby-2/.devcontainer` to the root of your project folder.
|
||||
2. Copy the contents of `containers/ruby/.devcontainer` to the root of your project folder.
|
||||
3. Start VS Code and open your project folder.
|
||||
|
||||
4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.
|
||||
|
@ -39,7 +57,7 @@ This definition includes some test code that will help you verify it is working
|
|||
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
|
||||
2. Clone this repository.
|
||||
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
|
||||
4. Select the `containers/ruby-2` folder.
|
||||
4. Select the `containers/ruby` folder.
|
||||
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
|
||||
6. You should see "Hello, Remote Extension Host!" followed by "Hello, Local Extension Host!" in the Debug Console after the program executes.
|
||||
7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.
|
Загрузка…
Ссылка в новой задаче