Skip to content

Commit

Permalink
feat: simplified cloudbuild builder image
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelcoeffic committed Oct 22, 2023
1 parent a608af4 commit a2c5c37
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 6 deletions.
48 changes: 43 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,22 +45,60 @@ 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
push: true
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:
- 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
Expand All @@ -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
Expand Down
37 changes: 36 additions & 1 deletion builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a2c5c37

Please sign in to comment.