Skip to content

Commit 3dc98b1

Browse files
committed
added build script
1 parent e6a0dba commit 3dc98b1

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

build.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
readonly path="$1"
6+
readonly container=$(echo $path | cut -d '/' -f 1)
7+
readonly version=$(echo $path | cut -d '/' -f 2)
8+
9+
now="$(date --utc --iso-8601=seconds)"
10+
repo_url="https://github.com/BioImageTools/containers"
11+
tag="ghcr.io/bioimagetools/$container:$version"
12+
13+
docker build \
14+
--label org.opencontainers.image.source="$repo_url" \
15+
--label org.opencontainers.image.created="$now" \
16+
--tag $tag \
17+
./$container/$version
18+
19+
read -r -p "Do you want to push this image to GCR? [y/N] " response
20+
case "$response" in
21+
[yY][eE][sS]|[yY])
22+
docker push $tag
23+
;;
24+
*)
25+
echo "You can push it later like this: docker push $tag"
26+
;;
27+
esac
28+

0 commit comments

Comments
 (0)