Skip to content

Commit e90c404

Browse files
committed
Make features configurable on Docker build
Default to 'all' features on dockerfile, but publish only hostapps support on the default image and add an 'unstable' tag with additional features Change-type: minor
1 parent 015e772 commit e90c404

File tree

5 files changed

+39
-3
lines changed

5 files changed

+39
-3
lines changed

.github/workflows/flowzone.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
with:
5151
docker_images: |
5252
ghcr.io/balena-io/helios
53+
bake_targets: |
54+
default,
55+
unstable
5356
# The dockerfile runs its own tests so only test building
5457
# for aarch64
5558
cargo_targets: aarch64-unknown-linux-gnu

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
# Comma-separated list of features
2+
ARG HELIOS_FEATURES=all
3+
14
FROM alpine:3.22 AS build
25

6+
ARG HELIOS_FEATURES
7+
38
# Install build dependencies
49
RUN apk add --update --no-cache \
510
build-base \
@@ -21,7 +26,7 @@ COPY helios-util ./helios-util
2126

2227
# Build release
2328
# Unit tests are run separately by CI
24-
RUN cargo build --release --locked
29+
RUN cargo build --no-default-features --features $HELIOS_FEATURES --release --locked
2530

2631
# Release target
2732
FROM alpine:3.22

docker-bake.hcl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
target "default" {
22
context = "./"
33
dockerfile = "Dockerfile"
4+
args = {
5+
HELIOS_FEATURES = "hostapps"
6+
}
7+
platforms = [
8+
"linux/386",
9+
"linux/amd64",
10+
"linux/arm64",
11+
"linux/arm/v6",
12+
"linux/arm/v7",
13+
]
14+
}
15+
16+
17+
target "unstable" {
18+
context = "./"
19+
dockerfile = "Dockerfile"
20+
args = {
21+
HELIOS_FEATURES = "all"
22+
}
423
platforms = [
524
"linux/386",
625
"linux/amd64",

docker-compose.test.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ services:
1414
condition: service_started
1515

1616
helios-api:
17-
build: ./
17+
build:
18+
context: ./
19+
args:
20+
HELIOS_FEATURES: all
1821
image: helios
1922
command: socat TCP-LISTEN:80,reuseaddr,fork UNIX-CONNECT:/tmp/run/helios.sock
2023
depends_on:
@@ -27,6 +30,11 @@ services:
2730

2831
# Override default configurations
2932
helios:
33+
build:
34+
context: ./
35+
args:
36+
HELIOS_FEATURES: all
37+
image: helios
3038
# Set-up required variables
3139
environment:
3240
DOCKER_HOST: 'unix:///var/run/docker.sock'

helios/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ tracing-subscriber.workspace = true
2626
tracing.workspace = true
2727

2828
[features]
29-
default = ["userapps", "balenahup", "v3-api"]
29+
default = ["all"]
30+
all = ["userapps", "balenahup", "v3-api"]
3031
userapps = ["helios-state/userapps"]
3132
balenahup = ["helios-state/balenahup"]
3233
v3-api = ["helios-api/v3"]

0 commit comments

Comments
 (0)