Skip to content

Commit

Permalink
feat(Golang): make support for alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
Fab1o0107 committed Dec 12, 2023
1 parent 8a3b26a commit d91c7b7
Show file tree
Hide file tree
Showing 17 changed files with 292 additions and 0 deletions.
16 changes: 16 additions & 0 deletions golang/1.14/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# TAGS:
# VARIANT: alpine
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.14-alpine

ARG BUILDPLATFORM

RUN apk add --update --no-cache tini ca-certificates curl ffmpeg git openssl sqlite tar tzdata build-base \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/ash", "/entrypoint.sh"]
17 changes: 17 additions & 0 deletions golang/1.14/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TAGS:
# VARIANT:
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.14-bullseye

ARG BUILDPLATFORM

RUN apt update \
&& apt install -y git build-essential ca-certificates iputils-ping curl iproute2 ffmpeg procps tini tar tzdata \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
16 changes: 16 additions & 0 deletions golang/1.15/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# TAGS:
# VARIANT: alpine
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.15.15-alpine

ARG BUILDPLATFORM

RUN apk add --update --no-cache tini ca-certificates curl ffmpeg git openssl sqlite tar tzdata build-base \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/ash", "/entrypoint.sh"]
17 changes: 17 additions & 0 deletions golang/1.15/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TAGS:
# VARIANT:
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.15.15-bullseye

ARG BUILDPLATFORM

RUN apt update \
&& apt install -y git build-essential ca-certificates iputils-ping curl iproute2 ffmpeg procps tini tar tzdata \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
16 changes: 16 additions & 0 deletions golang/1.16/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# TAGS:
# VARIANT: alpine
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.16.15-alpine

ARG BUILDPLATFORM

RUN apk add --update --no-cache tini ca-certificates curl ffmpeg git openssl sqlite tar tzdata build-base \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/ash", "/entrypoint.sh"]
17 changes: 17 additions & 0 deletions golang/1.16/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TAGS:
# VARIANT:
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.16.15-bullseye

ARG BUILDPLATFORM

RUN apt update \
&& apt install -y git build-essential ca-certificates iputils-ping curl iproute2 ffmpeg procps tini tar tzdata \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
16 changes: 16 additions & 0 deletions golang/1.17/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# TAGS:
# VARIANT: alpine
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.17.13-alpine

ARG BUILDPLATFORM

RUN apk add --update --no-cache tini ca-certificates curl ffmpeg git openssl sqlite tar tzdata build-base \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/ash", "/entrypoint.sh"]
17 changes: 17 additions & 0 deletions golang/1.17/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TAGS:
# VARIANT:
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.17.13-bullseye

ARG BUILDPLATFORM

RUN apt update \
&& apt install -y git build-essential ca-certificates iputils-ping curl iproute2 ffmpeg procps tini tar tzdata \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
16 changes: 16 additions & 0 deletions golang/1.18/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# TAGS:
# VARIANT: alpine
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.18.10-alpine

ARG BUILDPLATFORM

RUN apk add --update --no-cache tini ca-certificates curl ffmpeg git openssl sqlite tar tzdata build-base \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/ash", "/entrypoint.sh"]
17 changes: 17 additions & 0 deletions golang/1.18/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TAGS:
# VARIANT:
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.18.10-bullseye

ARG BUILDPLATFORM

RUN apt update \
&& apt install -y git build-essential ca-certificates iputils-ping curl iproute2 ffmpeg procps tini tar tzdata \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
16 changes: 16 additions & 0 deletions golang/1.19/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# TAGS:
# VARIANT: alpine
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.19.13-alpine

ARG BUILDPLATFORM

RUN apk add --update --no-cache tini ca-certificates curl ffmpeg git openssl sqlite tar tzdata build-base \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/ash", "/entrypoint.sh"]
17 changes: 17 additions & 0 deletions golang/1.19/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TAGS:
# VARIANT:
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.19.13-bullseye

ARG BUILDPLATFORM

RUN apt update \
&& apt install -y git build-essential ca-certificates iputils-ping curl iproute2 ffmpeg procps tini tar tzdata \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
16 changes: 16 additions & 0 deletions golang/1.20/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# TAGS:
# VARIANT: alpine
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.20.12-alpine

ARG BUILDPLATFORM

RUN apk add --update --no-cache tini ca-certificates curl ffmpeg git openssl sqlite tar tzdata build-base \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/ash", "/entrypoint.sh"]
17 changes: 17 additions & 0 deletions golang/1.20/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TAGS:
# VARIANT:
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.20.12-bullseye

ARG BUILDPLATFORM

RUN apt update \
&& apt install -y git build-essential ca-certificates iputils-ping curl iproute2 ffmpeg procps tini tar tzdata \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
16 changes: 16 additions & 0 deletions golang/1.21/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# TAGS: latest
# VARIANT: alpine
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.21.5-alpine

ARG BUILDPLATFORM

RUN apk add --update --no-cache tini ca-certificates curl ffmpeg git openssl sqlite tar tzdata build-base \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/ash", "/entrypoint.sh"]
17 changes: 17 additions & 0 deletions golang/1.21/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TAGS: latest
# VARIANT:
# PLATFORMS: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/ppc64le, linux/s390x
FROM golang:1.21.5-bullseye

ARG BUILDPLATFORM

RUN apt update \
&& apt install -y git build-essential ca-certificates iputils-ping curl iproute2 ffmpeg procps tini tar tzdata \
&& addgroup -S container && adduser -D -h /home/container -S -G container container

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

COPY ../../entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
28 changes: 28 additions & 0 deletions golang/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# 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

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

# Print Go version
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mgo version\n"
go version

# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell
# variable format of "${VARIABLE}" before evaluating the string and automatically
# replacing the values.
PARSED=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g'))

# Display the command we're running in the output, and then execute it with the env
# from the container itself.
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED"

# shellcheck disable=SC2086
eval ${PARSED}

0 comments on commit d91c7b7

Please sign in to comment.