diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 4b8d2e0..469c38f 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -15,14 +15,14 @@ on: - '**.md' jobs: - build: + dev: runs-on: ubuntu-latest steps: - name: Check out the repo uses: actions/checkout@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Docker metadata id: meta @@ -45,7 +45,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Push edgetx-dev - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: dev/ file: dev/Dockerfile @@ -53,6 +53,44 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + builder: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: | + name=ghcr.io/edgetx/edgetx-builder + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push edgetx-builder + uses: docker/build-push-action@v5 + with: + context: builder/ + file: builder/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + gitpod: runs-on: ubuntu-latest steps: @@ -60,7 +98,7 @@ jobs: uses: actions/checkout@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Docker metadata id: meta @@ -83,7 +121,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Push edgetx-dev - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: gitpod/ file: gitpod/Dockerfile diff --git a/builder/Dockerfile b/builder/Dockerfile index 1a28ce7..d264154 100644 --- a/builder/Dockerfile +++ b/builder/Dockerfile @@ -1,4 +1,39 @@ -FROM ghcr.io/edgetx/edgetx-dev:2.9.0 +ARG OS_CODENAME=jammy + +FROM ubuntu:${OS_CODENAME} + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install --yes --no-install-recommends \ + build-essential \ + dumb-init \ + python3-clang \ + cmake \ + git \ + zip \ + unzip \ + file \ + wget \ + python3-pip \ + gawk && \ + rm -rf /var/lib/apt/lists/* + +RUN wget --quiet https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -O - \ + | tar -xj -C /opt + +RUN python3 -m pip install -U pip setuptools \ + && python3 -m pip install \ + asciitree \ + jinja2 \ + pillow \ + lz4 + +ENV PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/:${PATH} + +VOLUME ["/src"] + +ENTRYPOINT ["/usr/bin/dumb-init", "--"] RUN useradd --create-home --shell /bin/bash rootless RUN mkdir -p /home/rootless/src