From abffbcc2d0006910bf5c2e993747ab35b99b429d Mon Sep 17 00:00:00 2001 From: Anthony Anderson Date: Mon, 16 May 2022 11:30:57 -0400 Subject: [PATCH] ara/add-docker-container-devrel-support --- .devcontainer/devcontainer.json | 22 ++++++++++++++++++++++ .devcontainer/remote.Dockerfile | 24 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/remote.Dockerfile diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..be9fa531c --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,22 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.159.0/containers/javascript-node +{ + "name": "Erlang", + "build": { + "dockerfile": "remote.Dockerfile", + "args": { "VARIANT": "24.3.4.0-alpine" } + }, + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/sh" + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "pgourlain.erlang" + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [3000], +} diff --git a/.devcontainer/remote.Dockerfile b/.devcontainer/remote.Dockerfile new file mode 100644 index 000000000..40a32387e --- /dev/null +++ b/.devcontainer/remote.Dockerfile @@ -0,0 +1,24 @@ +# [Choice] alpine,... +ARG VARIANT="alpine" +FROM erlang:${VARIANT} as deps-compiler + +ENV DEBIAN_FRONTEND=noninteractive + +# Setup rebar diagnostics +ARG REBAR_DIAGNOSTIC=0 +ENV DIAGNOSTIC=${REBAR_DIAGNOSTIC} + +ENV CC=gcc CXX=g++ CFLAGS="-U__sun__" \ + ERLANG_ROCKSDB_OPTS="-DWITH_BUNDLE_SNAPPY=ON -DWITH_BUNDLE_LZ4=ON" \ + ERL_COMPILER_OPTIONS="[deterministic]" \ + PATH="/root/.cargo/bin:$PATH" \ + RUSTFLAGS="-C target-feature=-crt-static" + +# Install dependencies to build +RUN apk add --no-cache --update \ + autoconf automake bison build-base bzip2 cmake curl \ + dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 \ + openssl-dev pkgconfig protoc sed tar wget bash parallel + +# Install Rust toolchain +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y