Changed version to use build args

This commit is contained in:
Aditya Prima 2023-11-25 13:17:28 +07:00
parent f16fbdfbd5
commit 183bc740fb
1 changed files with 14 additions and 4 deletions

View File

@ -1,22 +1,32 @@
FROM alpine:3.15 ARG ALPINE_VERSION=3.18
FROM alpine:${ALPINE_VERSION} AS base
LABEL maintainer="<Aditya Prima> aprimediet@gmail.com" LABEL maintainer="<Aditya Prima> aprimediet@gmail.com"
# Add s6-overlay # Add s6-overlay
ENV S6_OVERLAY_VERSION=v3.1.5.0 ENV S6_OVERLAY_VERSION=v3.1.5.0
# Add dependency mirror
RUN touch /etc/apk/repositories
RUN echo http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main >> /etc/apk/repositories
RUN echo http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community >> /etc/apk/repositories
# Install base dependencies # Install base dependencies
RUN apk add --update --no-cache bash libcap RUN apk add --update --no-cache bash libcap curl
# Get S6-OVERLAY # Get S6-OVERLAY
ADD https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp/ ADD https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp/ ADD https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp
# Install S6-Overlay # Install S6-Overlay
RUN tar -Jxpf /tmp/s6-overlay-noarch.tar.xz -C / RUN tar -Jxpf /tmp/s6-overlay-noarch.tar.xz -C /
RUN tar -Jxpf /tmp/s6-overlay-x86_64.tar.xz -C / RUN tar -Jxpf /tmp/s6-overlay-x86_64.tar.xz -C /
RUN tar -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz -C /
# Remove S6-Overlay # Remove S6-Overlay
RUN rm -f /tmp/s6-overlay-noarch.tar.xz RUN rm -f /tmp/s6-overlay-noarch.tar.xz
RUN rm -f /tmp/s6-overlay-x76_64.tar.xz RUN rm -f /tmp/s6-overlay-x76_64.tar.xz
RUN rm -f /tmp/s6-overlay-symlinks-noarch.tar.xz
ENTRYPOINT [ "/init" ] ENTRYPOINT [ "/init" ]