Skip to content

Commit

Permalink
scripts/build-container.sh: Use specific buildkit image version
Browse files Browse the repository at this point in the history
Reproducibility also depends on using the same buildkit version as the
pipeline. E.g., v0.13.0 and v0.16.0 generate different tar archives.

We are currently on v0.16.0 in the pipeline, enforce this also locally.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
jan-kiszka committed Dec 8, 2024
1 parent d38dc0c commit 984927a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/build-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# This needs to be aligned with .github/actions/docker-init/action.yml
BUILDKIT="moby/buildkit:v0.16.0"

usage()
{
DEFAULT_DEBIAN_TAG=$(grep -m 1 'ARG DEBIAN_TAG=' "$(dirname "$0")/../Dockerfile" |
Expand Down Expand Up @@ -130,6 +133,11 @@ if [ "$CLEAN" = y ]; then
done
fi

if ! docker buildx inspect | grep -q "Driver Options:.*$BUILDKIT"; then
BUILDX_INSTANCE=$(docker buildx create --driver-opt image="$BUILDKIT")
docker buildx use "$BUILDX_INSTANCE"
fi

KAS_CLONE=$(mktemp -d --tmpdir kas-tmp.XXXXXXXXXX)
git clone . "$KAS_CLONE"
cd "$KAS_CLONE" || exit 1
Expand Down

0 comments on commit 984927a

Please # to comment.