diff --git a/.dockerignore b/.dockerignore index cc67342..2faf5c9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ * !run-irods.sh !apt.irods +!VERSION diff --git a/Dockerfile b/Dockerfile index 115f4ba..802c603 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,15 +4,17 @@ FROM ubuntu:22.04 ADD --chmod=444 \ https://packages.irods.org/irods-signing-key.asc /etc/apt/trusted.gpg.d/irods-signing-key.asc -COPY apt.irods /etc/apt/preferences.d/irods +COPY --chmod=444 VERSION /IRODS_VERSION ARG DEBIAN_FRONTEND=noninteractive -RUN < /etc/apt/preferences.d/irods echo deb [arch=amd64] https://packages.irods.org/apt/ "$(lsb_release --codename --short)" main \ > /etc/apt/sources.list.d/renci-irods.list @@ -27,8 +29,10 @@ RUN < /var/lib/irods/version.json + mkdir /var/lib/irods/.irods chown --recursive irods:irods /var/lib/irods diff --git a/README.md b/README.md index c1cac27..c29d3f7 100644 --- a/README.md +++ b/README.md @@ -51,9 +51,16 @@ RUN chmod +x /control-status.sh CMD [ "/control-status.sh", "CoordRes" ] ``` +For convenience, the file `/IRODS_VERSION` in the image contains the version of iRODS in the image. The file has the version number on the first line. + +```console +prompt> cat /IRODS_VERSION +4.3.1 +``` + ## Building the Base Image -The command `./build` can be used to build the image. It creates the image `cyverse/irods` with tag `new`. +The command `./build` can be used to build the image. It creates the image `cyverse/irods` with tag `new`. The version of iRODS in the image is set in the file `./VERSION`. ```console prompt> ./build diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..f77856a --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +4.3.1 diff --git a/apt.irods b/apt.irods index 4397190..db87ee9 100644 --- a/apt.irods +++ b/apt.irods @@ -1,3 +1,3 @@ Package: irods-* -Pin: version 4.3.1 +Pin: version VERSION Pin-Priority: 1001 diff --git a/publish b/publish index b1e5970..5a33522 100755 --- a/publish +++ b/publish @@ -8,13 +8,17 @@ set -o errexit -o nounset -o pipefail -readonly IRODS_RELEASE='4.3.1' +EXEC_DIR="$(dirname "$(realpath --canonicalize-existing)")" +readonly EXEC_DIR readonly IMAGE_NAME=cyverse/irods readonly NEW_IMAGE="$IMAGE_NAME":new readonly CUR_IMAGE="$IMAGE_NAME":latest main() { + local irodsVer + IFS= read -r irodsVer < "$EXEC_DIR"/VERSION + local newId newId="$(docker image inspect "$NEW_IMAGE" | jq .[0].Id)" @@ -28,7 +32,7 @@ main() { now="$(date --utc '+%Y-%m-%dT%H-%M-%S')" local tag - for tag in "$IRODS_RELEASE"_"$now" "$IRODS_RELEASE" latest; do + for tag in "$irodsVer"_"$now" "$irodsVer" latest; do publish "$tag" done fi