Skip to content

Commit

Permalink
Add org.opencontainers labels (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvizeli authored Apr 13, 2021
1 parent b2cc138 commit b77028a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN \
&& apk add --no-cache \
git \
docker \
coreutils \
&& apk add --no-cache --virtual .build-dependencies \
build-base \
go \
Expand Down
12 changes: 6 additions & 6 deletions builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,21 +264,21 @@ function run_build() {
docker_cli+=("--no-cache")
fi

# do we know the arch of build?
if bashio::var.has_value "${build_arch}"; then
docker_cli+=("--label" "io.hass.arch=${build_arch}")
docker_cli+=("--build-arg" "BUILD_ARCH=${build_arch}")
fi
# Set Labels
docker_cli+=("--label" "io.hass.arch=${build_arch}")
docker_cli+=("--label" "io.hass.version=${version}")
docker_cli+=("--label" "org.opencontainers.image.version=${version}")
docker_cli+=("--label" "org.opencontainers.image.created=$(date --rfc-3339=seconds --utc)")

# Validate the base image
codenotary_validate "${VCN_FROM}" "${build_from}" "true"

# Build image
bashio::log.info "Run build for ${repository}/${image}:${version}"
docker build --pull -t "${repository}/${image}:${version}" \
--label "io.hass.version=${version}" \
--build-arg "BUILD_FROM=${build_from}" \
--build-arg "BUILD_VERSION=${version}" \
--build-arg "BUILD_ARCH=${build_arch}" \
"${docker_cli[@]}" \
"${build_dir}"

Expand Down

0 comments on commit b77028a

Please sign in to comment.