Add code-server and devcontainer images, useful for VSCode

pull/93/head
Badlop 1 year ago
parent b5aa67be61
commit 01e416f0dd

@ -0,0 +1,42 @@
name: code-server
on:
push:
paths:
- '.github/workflows/code-server.yml'
- 'code-server/**'
jobs:
code-server:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Build image
run: docker build
code-server
--tag code-server
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/code-server
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
docker tag code-server $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION

@ -0,0 +1,42 @@
name: devcontainer
on:
push:
paths:
- '.github/workflows/devcontainer.yml'
- 'devcontainer/**'
jobs:
devcontainer:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Build image
run: docker build
devcontainer
--tag devcontainer
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/devcontainer
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
docker tag devcontainer $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION

@ -6,10 +6,20 @@
This repository contains a set of Docker images for ejabberd:
- [mix](mix/) (in Docker Hub: [ejabberd/mix](https://hub.docker.com/r/ejabberd/mix/)):
allows you to build a development
environment for ejabberd, using all dependencies packaged from the Docker image. You do not
need anything else to build ejabberd from source and write your own ejabberd plugins.
Build a development environment for ejabberd. See [mix README](mix/README.md) file for details.
- [ecs](ecs/) (in Docker Hub: [ejabberd/ecs](https://hub.docker.com/r/ejabberd/ecs/)):
is suitable for running ejabberd with Docker in a simple, single-node setup.
Please read the README file in each repository for documentation for each image.
Run ejabberd with Docker in a simple, single-node setup.
See [ecs README](ecs/README.md) file for details.
- [code-server](code-server/) (in GitHub Container Registry: [processone/code-server](https://github.com/orgs/processone/packages/container/package/code-server)):
Run Coder's code-server with a local ejabberd git clone.
See [VSCode section](https://docs.ejabberd.im/developer/vscode/) in ejabberds Docs.
- [devcontainer](devcontainer/) (in GitHub Container Registry: [processone/devcontainer](https://github.com/orgs/processone/packages/container/package/devcontainer)):
Use as a Dev Container for ejabberd in Visual Studio Code.
See [VSCode section](https://docs.ejabberd.im/developer/vscode/) in ejabberds Docs.

@ -0,0 +1,26 @@
FROM debian:unstable-slim
RUN apt-get update \
&& apt-get -y --no-install-recommends install \
curl ca-certificates \
autoconf automake git make gcc g++ \
erlang erlang-dev elixir rebar3 \
libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev \
libssl-dev
RUN curl -fsSL https://code-server.dev/install.sh | sh
RUN addgroup vscode --gid 1000 \
&& adduser --shell /bin/bash --ingroup vscode vscode -u 1000
USER vscode
RUN /usr/bin/code-server --install-extension erlang-ls.erlang-ls
RUN echo "export PATH=/workspaces/ejabberd/_build/relive:$PATH" >>/home/vscode/.bashrc
RUN echo "COOKIE" >/home/vscode/.erlang.cookie
RUN chmod 400 /home/vscode/.erlang.cookie
WORKDIR /workspaces/ejabberd
ENTRYPOINT ["code-server", "--bind-addr", "0.0.0.0:5208", "--auth", "none", "/workspaces/ejabberd"]

@ -0,0 +1,65 @@
# [Choice] Alpine version: 3.16, 3.15, 3.14, 3.13
ARG VARIANT=latest
FROM alpine:${VARIANT}
RUN apk upgrade --update musl \
&& apk add \
autoconf \
automake \
bash \
build-base \
curl \
elixir \
erlang-debugger \
erlang-observer \
erlang-odbc \
erlang-reltool \
expat-dev \
file \
gd-dev \
git \
jpeg-dev \
libpng-dev \
libwebp-dev \
linux-pam-dev \
openssl \
openssl-dev \
sqlite-dev \
yaml-dev \
zlib-dev
# [Option] Install zsh
ARG INSTALL_ZSH="true"
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/devcontainers/images/main/src/base-alpine/.devcontainer/library-scripts/common-alpine.sh"
RUN apk update \
&& curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-alpine.sh \
&& ash /tmp/common-alpine.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" \
&& rm -rf /tmp/common-alpine.sh
RUN mix local.hex --force \
&& mix local.rebar --force
RUN apk add \
expat \
freetds \
gd \
jpeg \
libgd \
libpng \
libstdc++ \
libwebp \
linux-pam \
ncurses-libs \
openssl \
sqlite \
sqlite-libs \
unixodbc \
yaml \
zlib \
&& ln -fs /usr/lib/libtdsodbc.so.0 /usr/lib/libtdsodbc.so \
&& rm -rf /var/cache/apk/*
Loading…
Cancel
Save