Skip to content

Commit

Permalink
Build and publish helper images with Flowzone
Browse files Browse the repository at this point in the history
Rather than build helper images on demand, we will
publish them to ghcr.io with every revision of this project.

Change-type: minor
Signed-off-by: Kyle Harding <[email protected]>
  • Loading branch information
klutchell committed Jan 31, 2024
1 parent 0008306 commit 6bdca6c
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 30 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/flowzone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ jobs:
github.event_name == 'pull_request_target'
)
secrets: inherit
with:
docker_images: |
ghcr.io/balena-os/balena-yocto-scripts
bake_targets: yocto-build-env,yocto-block-build-env,balena-push-env,yocto-generate-ami-env
9 changes: 0 additions & 9 deletions automation/Dockerfile_balena-generate-ami-env

This file was deleted.

20 changes: 0 additions & 20 deletions automation/Dockerfile_yocto-block-build-env

This file was deleted.

33 changes: 32 additions & 1 deletion automation/Dockerfile_yocto-build-env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:18.04 AS yocto-build-env

ARG DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -46,3 +46,34 @@ COPY include/balena-docker.inc /
COPY entry_scripts/prepare-and-start.sh /

WORKDIR /work

####################

FROM yocto-build-env AS yocto-block-build-env

RUN apt-get update && apt-get install -y git make automake gcc libtool libtool-bin pkg-config libarchive-dev libcurl4-openssl-dev libssl-dev libgpgme11-dev && rm -rf /var/lib/apt/lists/*

RUN git clone git://git.yoctoproject.org/opkg opkg
RUN cd ./opkg && ./autogen.sh && ./configure --enable-libsolv && make && make install

RUN LD_LIBRARY_PATH=/usr/local/lib && ldconfig

RUN mkdir -p /var/lib/opkg /etc/opkg/
RUN echo 'dest hostapp /hostapp\n\
option info_dir /var/lib/opkg/info\n\
option lists_dir /var/lib/opkg/lists\n\
option status_file /var/lib/opkg/status'\
> /etc/opkg/opkg.conf

COPY include/balena-api.inc include/balena-lib.inc entry_scripts/balena-build-block.sh /
WORKDIR /

####################

FROM yocto-build-env AS yocto-generate-ami-env

RUN apt-get update && apt-get install -y python3-pip udev && rm -rf /var/lib/apt/lists/*
RUN pip3 install awscli

COPY include/balena-api.inc include/balena-lib.inc entry_scripts/balena-generate-ami.sh /
WORKDIR /
38 changes: 38 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
target "yocto-build-env" {
context = "automation"
dockerfile = "Dockerfile_yocto-build-env"
target = "yocto-build-env"
platforms = [
"linux/amd64",
// "linux/arm64"
]
}

target "yocto-block-build-env" {
context = "automation"
dockerfile = "Dockerfile_yocto-build-env"
target = "yocto-block-build-env"
platforms = [
"linux/amd64",
// "linux/arm64"
]
}

target "yocto-generate-ami-env" {
context = "automation"
dockerfile = "Dockerfile_yocto-build-env"
target = "yocto-generate-ami-env"
platforms = [
"linux/amd64",
// "linux/arm64"
]
}

target "balena-push-env" {
context = "automation"
dockerfile = "Dockerfile_balena-push-env"
platforms = [
"linux/amd64",
// "linux/arm64"
]
}

0 comments on commit 6bdca6c

Please sign in to comment.