From 052bc886c1f2257aa40d73a9bac7ce560f047f28 Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Thu, 11 Jan 2024 10:59:53 -0800 Subject: [PATCH] Allow publishing only 1 platform for docker/gstreamer images --- magefile.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/magefile.go b/magefile.go index db89e5a4..d7afa2b2 100644 --- a/magefile.go +++ b/magefile.go @@ -32,7 +32,15 @@ const ( libniceVersion = "0.1.21" chromiumVersion = "117.0.5874.0" dockerBuild = "docker build" - dockerBuildX = "docker buildx build --push --platform linux/amd64,linux/arm64" + dockerBuildX = "docker buildx build --push --platform " +) + +var ( + platforms = map[string]string{ + "all": "linux/amd64,linux/arm64", + "amd64": "linux/amd64", + "arm64": "linux/arm64", + } ) type packageInfo struct { @@ -137,12 +145,12 @@ func BuildChrome() error { ) } -func PublishChrome() error { +func PublishChrome(env string) error { return mageutil.Run(context.Background(), "docker pull ubuntu:22.04", fmt.Sprintf( - "%s -t livekit/chrome-installer:%s ./build/chrome", - dockerBuildX, chromiumVersion, + "%s%s -t livekit/chrome-installer:%s ./build/chrome", + dockerBuildX, platforms[env], chromiumVersion, ), ) } @@ -158,8 +166,8 @@ func BuildGStreamer() error { return buildGstreamer(dockerBuild) } -func PublishGStreamer() error { - return buildGstreamer(dockerBuildX) +func PublishGStreamer(env string) error { + return buildGstreamer(dockerBuildX + platforms[env]) } func buildGstreamer(cmd string) error {