Skip to content

Commit

Permalink
DS-728 moved iRODS version definition into Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tedgin committed Jul 5, 2024
1 parent 63bf71c commit bd609a8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*
!run-irods.sh
!apt.irods
!VERSION
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
RUN --mount=target=/apt.irods,source=apt.irods <<EOF
set -o errexit
apt-get update
apt-get --yes install apt-utils
apt-get --yes install ca-certificates gnupg lsb-release
IFS= read -r irodsVer < /IRODS_VERSION
sed 's/VERSION/'"$irodsVer"'/' /apt.irods > /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
Expand All @@ -27,8 +29,10 @@ RUN <<EOF

### Initialize server
apt-get --yes install jq

jq ".installation_time |= \"$(date '+%Y-%m-%dT%T.%6N')\"" /var/lib/irods/version.json.dist \
> /var/lib/irods/version.json

mkdir /var/lib/irods/.irods
chown --recursive irods:irods /var/lib/irods

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.3.1
2 changes: 1 addition & 1 deletion apt.irods
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Package: irods-*
Pin: version 4.3.1
Pin: version VERSION
Pin-Priority: 1001
8 changes: 6 additions & 2 deletions publish
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand All @@ -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
Expand Down

0 comments on commit bd609a8

Please sign in to comment.