mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Dockerfile: Provide specific OTP and elixir vsn for direct compilation
Ejabberd images can now be built with specific erlang/OTP and elixir vsn with the new build arguments OTP_VSN and ELIXIR_VSN.
This commit is contained in:
parent
bb8e892323
commit
2428f74fbd
24
.github/container/Dockerfile
vendored
24
.github/container/Dockerfile
vendored
@ -1,5 +1,6 @@
|
|||||||
#' Define default build variables
|
#' Define default build variables
|
||||||
ARG ALPINE_VSN='3.17'
|
ARG OTP_VSN='25.3'
|
||||||
|
ARG ELIXIR_VSN='1.14.4'
|
||||||
ARG UID='9000'
|
ARG UID='9000'
|
||||||
ARG USER='ejabberd'
|
ARG USER='ejabberd'
|
||||||
ARG HOME="opt/$USER"
|
ARG HOME="opt/$USER"
|
||||||
@ -9,7 +10,7 @@ ARG VERSION='master'
|
|||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#' METHOD='direct' - build and install ejabberd directly from source
|
#' METHOD='direct' - build and install ejabberd directly from source
|
||||||
FROM alpine:${ALPINE_VSN} AS direct
|
FROM docker.io/erlang:${OTP_VSN}-alpine AS direct
|
||||||
|
|
||||||
RUN apk -U add --no-cache \
|
RUN apk -U add --no-cache \
|
||||||
autoconf \
|
autoconf \
|
||||||
@ -17,9 +18,6 @@ RUN apk -U add --no-cache \
|
|||||||
bash \
|
bash \
|
||||||
build-base \
|
build-base \
|
||||||
curl \
|
curl \
|
||||||
elixir \
|
|
||||||
erlang-odbc \
|
|
||||||
erlang-reltool \
|
|
||||||
expat-dev \
|
expat-dev \
|
||||||
file \
|
file \
|
||||||
gd-dev \
|
gd-dev \
|
||||||
@ -33,6 +31,13 @@ RUN apk -U add --no-cache \
|
|||||||
yaml-dev \
|
yaml-dev \
|
||||||
zlib-dev
|
zlib-dev
|
||||||
|
|
||||||
|
ARG ELIXIR_VSN
|
||||||
|
RUN wget -O - https://github.com/elixir-lang/elixir/archive/v$ELIXIR_VSN.tar.gz \
|
||||||
|
| tar -xzf -
|
||||||
|
|
||||||
|
WORKDIR elixir-$ELIXIR_VSN
|
||||||
|
RUN make install clean
|
||||||
|
|
||||||
RUN mix local.hex --force \
|
RUN mix local.hex --force \
|
||||||
&& mix local.rebar --force
|
&& mix local.rebar --force
|
||||||
|
|
||||||
@ -66,7 +71,7 @@ RUN wget -O "$HOME/conf/cacert.pem" 'https://curl.se/ca/cacert.pem' \
|
|||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#' METHOD='package' - install ejabberd from binary tarball package
|
#' METHOD='package' - install ejabberd from binary tarball package
|
||||||
FROM alpine:${ALPINE_VSN} AS package
|
FROM docker.io/erlang:${OTP_VSN}-alpine AS package
|
||||||
COPY tarballs/ejabberd-*-linux-musl-*.tar.gz /tmp/
|
COPY tarballs/ejabberd-*-linux-musl-*.tar.gz /tmp/
|
||||||
WORKDIR /rootfs
|
WORKDIR /rootfs
|
||||||
ARG HOME
|
ARG HOME
|
||||||
@ -127,7 +132,7 @@ RUN chown -R $UID:$UID $HOME
|
|||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#' METHOD='package' - install runtime dependencies
|
#' METHOD='package' - install runtime dependencies
|
||||||
FROM alpine:${ALPINE_VSN} AS runtime-package
|
FROM docker.io/erlang:${OTP_VSN}-alpine AS runtime-package
|
||||||
RUN apk -U upgrade --available --no-cache \
|
RUN apk -U upgrade --available --no-cache \
|
||||||
&& apk add --no-cache \
|
&& apk add --no-cache \
|
||||||
libcap2 \
|
libcap2 \
|
||||||
@ -149,6 +154,11 @@ ARG HOME
|
|||||||
RUN addgroup $USER -g $UID \
|
RUN addgroup $USER -g $UID \
|
||||||
&& adduser -s /sbin/nologin -D -u $UID -h /$HOME -G $USER $USER
|
&& adduser -s /sbin/nologin -D -u $UID -h /$HOME -G $USER $USER
|
||||||
|
|
||||||
|
RUN apk del .erlang-rundeps \
|
||||||
|
&& rm -f $(which rebar3) \
|
||||||
|
&& find /usr -type d -name 'erlang' -exec rm -rf {} + \
|
||||||
|
&& find /usr -type l -exec test ! -e {} \; -delete
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#' Build together production image
|
#' Build together production image
|
||||||
FROM scratch AS prod
|
FROM scratch AS prod
|
||||||
|
Loading…
Reference in New Issue
Block a user