Skip to content

Commit

Permalink
add elixir images
Browse files Browse the repository at this point in the history
  • Loading branch information
gOOvER committed Apr 20, 2024
1 parent 3c538bd commit f1686d5
Show file tree
Hide file tree
Showing 8 changed files with 394 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/dev-elixir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: build elixir

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"
push:
branches:
- main
paths:
- dev/elixir/**

env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

jobs:
push:
name: "elixir:${{ matrix.tag }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tag:
- '1.12'
- '1.13'
- '1.14'
- '1.15'
- '1.16'
- latest

steps:
- uses: actions/checkout@v4

- uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v5
with:
context: ./dev/elixir
file: ./dev/elixir/${{ matrix.tag }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/goover/elixir:${{ matrix.tag }}
50 changes: 50 additions & 0 deletions dev/elixir/1.12/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM --platform=$TARGETOS/$TARGETARCH elixir:1.12-slim

LABEL author="Torsten Widmann" maintainer="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/gOOvER/own-pterodactyl-images"
LABEL org.opencontainers.image.licenses=MIT

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update \
&& apt -y upgrade

RUN apt install -y \
apt-transport-https \
build-essential \
ca-certificates \
curl \
dnsutils \
ffmpeg \
git \
iproute2 \
libsqlite3-dev \
libtool \
locales \
sqlite3 \
tar \
tini \
tzdata \
wget \
zip

# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

## Setup user and working directory
RUN useradd -m -d /home/container -s /bin/bash container
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

# Sets the default stop signal as wings can (currently) only send a kill or generic stop
STOPSIGNAL SIGINT

COPY --chown=container:container ../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]
50 changes: 50 additions & 0 deletions dev/elixir/1.13/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM --platform=$TARGETOS/$TARGETARCH elixir:1.13-slim

LABEL author="Torsten Widmann" maintainer="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/gOOvER/own-pterodactyl-images"
LABEL org.opencontainers.image.licenses=MIT

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update \
&& apt -y upgrade

RUN apt install -y \
apt-transport-https \
build-essential \
ca-certificates \
curl \
dnsutils \
ffmpeg \
git \
iproute2 \
libsqlite3-dev \
libtool \
locales \
sqlite3 \
tar \
tini \
tzdata \
wget \
zip

# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

## Setup user and working directory
RUN useradd -m -d /home/container -s /bin/bash container
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

# Sets the default stop signal as wings can (currently) only send a kill or generic stop
STOPSIGNAL SIGINT

COPY --chown=container:container ../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]
50 changes: 50 additions & 0 deletions dev/elixir/1.14/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM --platform=$TARGETOS/$TARGETARCH elixir:1.14-slim

LABEL author="Torsten Widmann" maintainer="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/gOOvER/own-pterodactyl-images"
LABEL org.opencontainers.image.licenses=MIT

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update \
&& apt -y upgrade

RUN apt install -y \
apt-transport-https \
build-essential \
ca-certificates \
curl \
dnsutils \
ffmpeg \
git \
iproute2 \
libsqlite3-dev \
libtool \
locales \
sqlite3 \
tar \
tini \
tzdata \
wget \
zip

# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

## Setup user and working directory
RUN useradd -m -d /home/container -s /bin/bash container
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

# Sets the default stop signal as wings can (currently) only send a kill or generic stop
STOPSIGNAL SIGINT

COPY --chown=container:container ../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]
50 changes: 50 additions & 0 deletions dev/elixir/1.15/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM --platform=$TARGETOS/$TARGETARCH elixir:1.15-slim

LABEL author="Torsten Widmann" maintainer="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/gOOvER/own-pterodactyl-images"
LABEL org.opencontainers.image.licenses=MIT

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update \
&& apt -y upgrade

RUN apt install -y \
apt-transport-https \
build-essential \
ca-certificates \
curl \
dnsutils \
ffmpeg \
git \
iproute2 \
libsqlite3-dev \
libtool \
locales \
sqlite3 \
tar \
tini \
tzdata \
wget \
zip

# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

## Setup user and working directory
RUN useradd -m -d /home/container -s /bin/bash container
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

# Sets the default stop signal as wings can (currently) only send a kill or generic stop
STOPSIGNAL SIGINT

COPY --chown=container:container ../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]
50 changes: 50 additions & 0 deletions dev/elixir/1.16/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM --platform=$TARGETOS/$TARGETARCH elixir:1.16-slim

LABEL author="Torsten Widmann" maintainer="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/gOOvER/own-pterodactyl-images"
LABEL org.opencontainers.image.licenses=MIT

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update \
&& apt -y upgrade

RUN apt install -y \
apt-transport-https \
build-essential \
ca-certificates \
curl \
dnsutils \
ffmpeg \
git \
iproute2 \
libsqlite3-dev \
libtool \
locales \
sqlite3 \
tar \
tini \
tzdata \
wget \
zip

# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

## Setup user and working directory
RUN useradd -m -d /home/container -s /bin/bash container
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

# Sets the default stop signal as wings can (currently) only send a kill or generic stop
STOPSIGNAL SIGINT

COPY --chown=container:container ../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]
40 changes: 40 additions & 0 deletions dev/elixir/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
#System variables
clear
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'

# Switch to the container's working directory
cd /home/container || exit 1

# Wait for the container to fully initialize
sleep 1

# Default the TZ environment variable to UTC.
TZ=${TZ:-UTC}
export TZ

# Set environment variable that holds the Internal Docker IP
INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}')
export INTERNAL_IP

# system informations
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
echo -e "${RED}BUN Image by gOOvER${NC}"
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
echo -e "${YELLOW}Running on Debian: ${RED} $(cat /etc/debian_version)${NC}"
echo -e "${YELLOW}Current timezone: ${RED} $(cat /etc/timezone)${NC}"
echo -e "${BLUE}---------------------------------------------------------------------${NC}"
echo -e "${YELLOW}Elixir Version: ${RED} $(elixir -e 'IO.puts "Elixir " <> System.version()') ${NC}"
echo -e "${BLUE}---------------------------------------------------------------------${NC}"


# Replace Startup Variables
MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo -e ":/home/container$ ${MODIFIED_STARTUP}"

# Run the Server
eval ${MODIFIED_STARTUP}
Loading

0 comments on commit f1686d5

Please sign in to comment.