代码拉取完成,页面将自动刷新
#!/bin/sh
#
# Copyright (c) 2021 VMware, Inc.
# SPDX-License-Identifier: BSD-2-Clause
# This script will build a container image with a golang1.16.6 binary installed
# The SBOM for the golang binary is created by hand (but it could be the output of
# a golang release.
# We create a container image using buildah from the previously built debian:10 image
echo starting...
ctr=$(buildah from localhost:5000/debian:10)
buildah unshare buildah mount $ctr
echo building container...
# Install golang
buildah unshare buildah run $ctr /bin/bash -c "apt-get update && apt-get install -y wget && wget https://golang.org/dl/go1.16.6.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.16.6.linux-amd64.tar.gz && apt-get remove -y wget"
buildah config --env PATH=/bin:/usr/local/go/bin $ctr
# Create our golang image
img=$(buildah commit $ctr localhost:5000/golang:1.16.6)
# Upload the golang image with the corresponding sboms
oras pull localhost:5000/debian-sbom:10 -a
buildah push --tls-verify=false localhost:5000/golang:1.16.6
oras push localhost:5000/golang-sbom:1.16.6 debian-sbom:application/json golang1.16.6-sbom:application/json
# Clean up all the containers
buildah rm --all
echo ready
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。