ci: stop building alpine docker image

This commit is contained in:
Ivan Dyachkov 2023-02-06 11:00:29 +01:00
parent 373947a4b9
commit 202f6d0181
5 changed files with 7 additions and 99 deletions

View File

@ -6,4 +6,3 @@ LDAP_TAG=2.4.50
INFLUXDB_TAG=2.5.0
TARGET=emqx/emqx
EMQX_TAG=build-alpine-amd64

View File

@ -117,14 +117,10 @@ jobs:
matrix:
profile:
- "${{ needs.prepare.outputs.PROFILE }}"
flavor:
- ''
- '-elixir'
registry:
- 'docker.io'
- 'public.ecr.aws'
os:
- [alpine3.15.1, "alpine:3.15.1", "deploy/docker/Dockerfile.alpine"]
- [debian11, "debian:11-slim", "deploy/docker/Dockerfile"]
# NOTE: 'otp' and 'elixir' are to configure emqx-builder image
# only support latest otp and elixir, not a matrix
@ -133,12 +129,11 @@ jobs:
otp:
- 24.3.4.2-1 # switch to 25 once ready to release 5.1
elixir:
- 1.13.4 # update to latest
- 'no_elixir'
- '1.13.4' # update to latest
exclude: # TODO: publish enterprise to ecr too?
- registry: 'public.ecr.aws'
profile: emqx-enterprise
- flavor: '-elixir'
os: [alpine3.15.1, "alpine:3.15.1", "deploy/docker/Dockerfile.alpine"]
steps:
- uses: actions/download-artifact@v3
@ -173,14 +168,10 @@ jobs:
run: |
extra_labels=
img_suffix=
flavor="${{ matrix.flavor }}"
if [ "${{ matrix.flavor }}" = '-elixir' ]; then
if [ "${{ matrix.elixir }}" != 'no_elixir' ]; then
img_suffix="-elixir"
extra_labels="org.opencontainers.image.elixir.version=${{ matrix.elixir }}"
fi
if [[ "${{ matrix.os[0] }}" =~ "alpine" ]]; then
img_suffix="${img_suffix}-alpine"
fi
echo "img_suffix=$img_suffix" >> $GITHUB_OUTPUT
echo "extra_labels=$extra_labels" >> $GITHUB_OUTPUT
@ -209,6 +200,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
EMQX_NAME=${{ matrix.profile }}${{ matrix.flavor }}
EMQX_NAME=${{ matrix.profile }}${{ steps.pre-meta.outputs.img_suffix }}
file: source/${{ matrix.os[2] }}
context: source

View File

@ -16,7 +16,7 @@ jobs:
prepare:
runs-on: ubuntu-20.04
# prepare source with any OTP version, no need for a matrix
container: ghcr.io/emqx/emqx-builder/5.0-27:1.13.4-24.3.4.2-1-alpine3.15.1
container: ghcr.io/emqx/emqx-builder/5.0-27:1.13.4-24.3.4.2-1-debian11
steps:
- uses: actions/checkout@v3
@ -47,7 +47,7 @@ jobs:
- mnesia
- rlog
os:
- ["alpine3.15.1", "alpine:3.15.1"]
- ["debian11", "debian:11-slim"]
builder:
- 5.0-27
otp:

8
build
View File

@ -322,13 +322,7 @@ make_tgz() {
make_docker() {
EMQX_BUILDER="${EMQX_BUILDER:-${EMQX_DEFAULT_BUILDER}}"
EMQX_RUNNER="${EMQX_RUNNER:-${EMQX_DEFAULT_RUNNER}}"
if [ -z "${EMQX_DOCKERFILE:-}" ]; then
if [[ "$EMQX_BUILDER" =~ "alpine" ]]; then
EMQX_DOCKERFILE='deploy/docker/Dockerfile.alpine'
else
EMQX_DOCKERFILE='deploy/docker/Dockerfile'
fi
fi
EMQX_DOCKERFILE="${EMQX_DOCKERFILE:-deploy/docker/Dockerfile}"
if [[ "$PROFILE" = *-elixir ]]; then
PKG_VSN="$PKG_VSN-elixir"
fi

View File

@ -1,76 +0,0 @@
ARG BUILD_FROM=ghcr.io/emqx/emqx-builder/5.0-26:1.13.4-24.3.4.2-1-alpine3.15.1
ARG RUN_FROM=alpine:3.15.1
FROM ${BUILD_FROM} AS builder
RUN apk add --no-cache \
autoconf \
automake \
bash \
bison \
bsd-compat-headers \
coreutils \
curl \
flex \
g++ \
gcc \
git \
jq \
libc-dev \
libstdc++ \
libtool \
make \
ncurses-dev \
openssl-dev \
perl
COPY . /emqx
ARG EMQX_NAME=emqx
ENV EMQX_RELUP=false
RUN export PROFILE=${EMQX_NAME%%-elixir} \
&& export EMQX_NAME1=$EMQX_NAME \
&& export EMQX_NAME=$PROFILE \
&& export EMQX_LIB_PATH="_build/$EMQX_NAME/lib" \
&& export EMQX_REL_PATH="/emqx/_build/$EMQX_NAME/rel/emqx" \
&& export EMQX_REL_FORM='docker' \
&& cd /emqx \
&& rm -rf $EMQX_LIB_PATH \
&& make $EMQX_NAME1 \
&& mkdir -p /emqx-rel \
&& mv $EMQX_REL_PATH /emqx-rel
FROM $RUN_FROM
COPY deploy/docker/docker-entrypoint.sh /usr/bin/
COPY --from=builder /emqx-rel/emqx /opt/emqx
RUN ln -s /opt/emqx/bin/* /usr/local/bin/
RUN apk add --no-cache curl ncurses-libs openssl sudo libstdc++ bash
WORKDIR /opt/emqx
RUN adduser -D -u 1000 emqx \
&& echo "emqx ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
RUN chgrp -Rf emqx /opt/emqx && chmod -Rf g+w /opt/emqx \
&& chown -Rf emqx /opt/emqx
USER emqx
VOLUME ["/opt/emqx/log", "/opt/emqx/data"]
# emqx will occupy these port:
# - 1883 port for MQTT
# - 8083 for WebSocket/HTTP
# - 8084 for WSS/HTTPS
# - 8883 port for MQTT(SSL)
# - 11883 port for internal MQTT/TCP
# - 18083 for dashboard and API
# - 4370 default Erlang distrbution port
# - 5369 for backplain gen_rpc
EXPOSE 1883 8083 8084 8883 11883 18083 4370 5369
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["/opt/emqx/bin/emqx", "foreground"]