From 584a1325f06808414e416180c106de755d4dcf2c Mon Sep 17 00:00:00 2001 From: rhliang Date: Fri, 15 Nov 2024 18:20:10 -0800 Subject: [PATCH] WIP: added some basic devcontainer config and a simple Dockerfile based on cfe_ubuntu. --- .devcontainer/Dockerfile | 28 ++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 15 +++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..12af011 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,28 @@ +ARG UBUNTU_VERSION=20.04 + +FROM ubuntu:${UBUNTU_VERSION} AS base + +ARG DEBIAN_FRONTEND=noninteractive + +ENV TZ=America/Vancouver \ + RUBY_VERSION=2.2.2 \ + BUNDLER_VERSION=1.17.3 + +RUN apt-get -y update &&\ + apt-get -y upgrade &&\ + apt-get install -y curl gpg + +RUN echo "deb http://security.ubuntu.com/ubuntu/ bionic-security main" >> /etc/apt/sources.list &&\ + echo "deb http://security.ubuntu.com/ubuntu/ bionic main" >> /etc/apt/sources.list &&\ + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 &&\ + apt update &&\ + apt install -y \ + gawk=1:4.1.4+dfsg-1build1 + +RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \ + curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \ + curl -sSL https://get.rvm.io | bash -s stable && \ + usermod -a -G rvm root + +RUN /bin/bash -l -c "source /etc/profile.d/rvm.sh && rvm pkg install openssl" +RUN /bin/bash -l -c "source /etc/profile.d/rvm.sh && rvm requirements && rvm install ${RUBY_VERSION} --with-openssl-dir=/usr/local/rvm/usr && rvm --default use ${RUBY_VERSION}" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..49fa4fd --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,15 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu +{ + "name": "CfE Ubuntu Ruby", + + "build": { + "dockerfile": "Dockerfile" + } + + "features": { + "ghcr.io/devcontainers/features/ruby:1": { + "version": "2.2" + } + } +}