Skip to content

Commit

Permalink
Merge pull request #70 from emqx/ubuntu-22.04
Browse files Browse the repository at this point in the history
feat: add ubuntu22.04
  • Loading branch information
id authored Jan 24, 2023
2 parents 3699889 + 9047d71 commit 7873d04
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ concurrency:
## Update the base image every day
on:
workflow_dispatch:
pull_request:
schedule:
## In UTC
- cron: '0 0 * * *'
Expand All @@ -23,6 +22,7 @@ jobs:
emqx_minor:
- "5.0"
platform:
- [ubuntu22.04 , "linux/amd64,linux/arm64"]
- [ubuntu20.04 , "linux/amd64,linux/arm64"]
- [ubuntu18.04 , "linux/amd64,linux/arm64"]
- [ubuntu16.04 , "linux/amd64,linux/arm64"]
Expand Down Expand Up @@ -60,7 +60,6 @@ jobs:
- name: Build base image
uses: docker/build-push-action@v3
with:
push: ${{ github.event_name != 'pull_request'}}
pull: true
cache-from: type=local,src=/tmp/.docker-buildx-cache,mode=max
cache-to: type=local,dest=/tmp/.docker-buildx-cache-new,mode=max
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
emqx_minor:
- "5.0"
platform:
- [ubuntu22.04 , "linux/amd64,linux/arm64"]
- [ubuntu20.04 , "linux/amd64,linux/arm64"]
- [ubuntu18.04 , "linux/amd64,linux/arm64"]
- [ubuntu16.04 , "linux/amd64,linux/arm64"]
Expand Down Expand Up @@ -100,6 +101,7 @@ jobs:
otp: ${{ fromJSON(needs.prepare.outputs.otp) }}
elixir: ${{ fromJSON(needs.prepare.outputs.elixir) }}
platform:
- [ubuntu22.04 , "linux/amd64,linux/arm64"]
- [ubuntu20.04 , "linux/amd64,linux/arm64"]
- [ubuntu18.04 , "linux/amd64,linux/arm64"]
- [ubuntu16.04 , "linux/amd64,linux/arm64"]
Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
otp: ${{ fromJSON(needs.prepare.outputs.otp) }}
elixir: ${{ fromJSON(needs.prepare.outputs.elixir) }}
platform:
- [ubuntu22.04 , "linux/amd64,linux/arm64"]
- [ubuntu20.04 , "linux/amd64,linux/arm64"]
- [ubuntu18.04 , "linux/amd64,linux/arm64"]
- [ubuntu16.04 , "linux/amd64,linux/arm64"]
Expand All @@ -54,22 +55,31 @@ jobs:
# - [raspbian9 , "linux/arm64"]
- [alpine3.15.1, "linux/amd64,linux/arm64"]

services:
registry:
image: registry:2
ports:
- 5000:5000

steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-qemu-action@v2
- uses: docker/login-action@v2
- uses: docker/setup-buildx-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
driver-opts: network=host
- name: Build base image
uses: docker/build-push-action@v3
with:
push: true
platforms: ${{ matrix.platform[1] }}
tags: localhost:5000/${{ github.repository }}/base-${{ matrix.emqx_minor }}:${{ matrix.platform[0] }}
file: ${{ matrix.platform[0] }}/Dockerfile
context: .
- uses: docker/build-push-action@v3
with:
push: false
pull: true
platforms: ${{ matrix.platform[1] }}
build-args: |
BUILD_FROM=ghcr.io/${{ github.repository }}/base-${{ matrix.emqx_minor }}:${{ matrix.platform[0] }}
BUILD_FROM=localhost:5000/${{ github.repository }}/base-${{ matrix.emqx_minor }}:${{ matrix.platform[0] }}
OTP_VERSION=${{ matrix.otp }}
ELIXIR_VERSION=${{ matrix.elixir }}
file: ./Dockerfile
Expand Down
68 changes: 68 additions & 0 deletions ubuntu22.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
ARG BUILD_FROM=ubuntu:22.04
FROM ${BUILD_FROM}

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
apt-transport-https \
autoconf \
automake \
autotools-dev \
bison \
build-essential \
ca-certificates \
cmake \
curl \
debhelper \
flex \
g++ \
gcc \
git \
inotify-tools \
jq \
libffi-dev \
libkrb5-3 \
libkrb5-dev \
libncurses5-dev \
libsasl2-2 \
libsasl2-dev \
libsasl2-modules-gssapi-mit \
libssl-dev \
libtool \
make \
python3 \
python3-pip \
software-properties-common \
unzip \
vim \
wget \
zip \
zlib1g-dev

# The following is not necessary for Kerberos authentication but makes testing
# https://github.com/kafka4beam/sasl_auth easier
RUN apt-get install -y \
krb5-kdc \
krb5-admin-server \
expect

RUN ln -sf /usr/bin/python3 /usr/bin/python
RUN ln -sf /usr/bin/pip3 /usr/bin/pip

RUN cmake --version

RUN apt-get update && apt-get install -y unixodbc unixodbc-dev

WORKDIR /


# cleanup
RUN apt-get clean\
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Elixir complains if runs without UTF-8
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

WORKDIR /
CMD [ "/bin/bash" ]

0 comments on commit 7873d04

Please sign in to comment.