You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I embedded some image metadata straight to one of my Dockerfiles, like this one below, to aid in debugging issues on an fresh Gitpod workspace.
# Source: https://gitlab.com/gitpodify/gitpodified-workspace-images/blob/ad23ccfac649e7f1ab3db219447bccaf01065de3/base/Dockerfile#L75-94ARG buildId=123e4567-e89b-12d3-a456-426652340000
ARG maintainer="Recap Time Squad <[email protected]>"ARG gitRepo=https://gitlab.com/gitpodify/gitpodified-workspace-images
ARG commitId=0000000000000000000000000000
LABEL dev.gitpodify.baseImage.buildId=${buildId} \
dev.gitpodify.baseImage.buildMaintainer=${maintainer} \
org.opencontainers.image.licenses=MIT \
org.opencontainers.image.source=${gitRepo} \
dev.gitpodify.baseImage.buildSource=${gitRepo} \
dev.gitpodify.baseImage.gitCommitSha=${commitId}
# Load build ID, maintainer and source metadata as env varsENV GITPODIFY_BASE_BUILD_ID=${buildId} \
GITPODIFY_BASE_BUILD_MAINTAINER=${maintainer} \
GITPODIFY_BASE_BUILD_SOURCE=${gitRepo} \
GITPODIFY_BASE_BUILD_COMMIT_SHA=${commitId} \
# GITPODIFY_IMAGE_BUILD_ID can be changed when built on other images base don it, so we're also provide# the GITPODIFY_BASE_BUILD_ID just in case.
GITPODIFY_IMAGE_BUILD_ID=${buildId} \
# For dotfiles support handling on install scripts and stuff
GITPODIFIED_WORKSPACE_IMAGE=true
The only problem is we embed two dynamic build argument called buildId and commitId. My build script generates the build ID through uuidgen package and also get the commit ID from Git through the git rev-parse HEAD command.
Suggestion
Add an --build-arg flag to the dazzle build command.
Workarounds
I can generate these values on the fly before using dazzle build using some cat <dazzle/chunks/name-here>/chunk.yml | envsubst >> <dazzle/chunks/name-here>/chunk.yml magic on the build script, through this add gettext package to list of required system packages to install, especially on Alpine Linux-based containers OR use docker build instead.
About this Issue
I embedded some image metadata straight to one of my Dockerfiles, like this one below, to aid in debugging issues on an fresh Gitpod workspace.
The only problem is we embed two dynamic build argument called
buildId
andcommitId
. My build script generates the build ID throughuuidgen
package and also get the commit ID from Git through thegit rev-parse HEAD
command.Suggestion
Add an
--build-arg
flag to thedazzle build
command.Workarounds
I can generate these values on the fly before using
dazzle build
using somecat <dazzle/chunks/name-here>/chunk.yml | envsubst >> <dazzle/chunks/name-here>/chunk.yml
magic on the build script, through this addgettext
package to list of required system packages to install, especially on Alpine Linux-based containers OR usedocker build
instead.Other notes
Currently, build arguments at build time are unsupported in Dazzle yet as per https://github.com/gitpod-io/dazzle#limitations-and-caveats.
The text was updated successfully, but these errors were encountered: