-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code-server and devcontainer images, useful for VSCode
- Loading branch information
Showing
5 changed files
with
190 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/* |