Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
4eUeP committed Feb 28, 2024
1 parent 1366186 commit d6a4ffa
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,23 @@ _buildx() {
image_name="$2"
target="$3"
tag="$4"
# Optional
build_args="$5"
test -n "$target" && target="--target $target"
metadata_file=$(mktemp)

# build and push digest
docker buildx build \
--file $dockerfile \
$target \
$target $build_args \
--output type=image,name=$image_name,push-by-digest=true,name-canonical=true,push=true \
--metadata-file $metadata_file \
.
digest=$(python3 -c "import json; d = json.load(open('$metadata_file')); print(d['containerimage.digest'])")

# writes to local image store, so it will appear in `docker images`
docker buildx build \
--file $dockerfile $target \
--file $dockerfile $target $build_args \
--output type=docker,name=$image_name:$tag .

# create tag from digests
Expand Down Expand Up @@ -151,6 +153,26 @@ hadmin_store() {
_buildx "dockerfiles/hadmin_store" "ghcr.io/hstreamdb/hadmin-store" "" "latest"
}

# build_haskell810
# haskell810() {
# cd $HS_DIR
#
# _buildx "Dockerfile" "hstreamdb/haskell" \
# "" "8.10.7" \
# "--build-arg GHC=8.10.7 --build-arg ld_client=hstreamdb/logdevice-client"
#
# ghc="$1"
# ld_client="$2"
# tag="$3"
# tag1="$4"
#
# $DOCKER_BIN build . -f Dockerfile \
# --build-arg GHC=$ghc \
# --build-arg LD_CLIENT_IMAGE=$ld_client \
# --tag hstreamdb/haskell:${tag}_$ARCH \
# --tag hstreamdb/haskell:${tag1}_$ARCH
# }

# -----------------------------------------------------------------------------
# Outdated
#
Expand Down Expand Up @@ -349,6 +371,7 @@ push_ghc_latest_manifest() {
}

# -----------------------------------------------------------------------------
# Outdated, TODO: remove

build_hsthrift() {
cd $HS_DIR
Expand All @@ -368,6 +391,7 @@ push_hsthrift_manifest() {
}

# -----------------------------------------------------------------------------
# Outdated, TODO: remove

build_hadmin_store() {
cd $HS_DIR
Expand Down

0 comments on commit d6a4ffa

Please sign in to comment.