#!/bin/sh
-container=$(buildah from argeo2-tp)
+source "$(dirname "$0")/buildah-metadata"
+container=$(buildah from argeo/argeo2-tp:$VERSION_ARGEO_TP-$ARCH)
+
+# Override version
+#buildah copy $container argeo2-rpmfactory.repo /etc/yum.repos.d/
+#buildah copy $container /srv/rpmfactory/argeo-osgi-2/el7/ /srv/rpmfactory/argeo-osgi-2/el7/
source "$(dirname "$0")/buildah-common"
buildah config --label release="1" $container
-buildah config --label version="$VERSION" $container
+buildah config --label version="$VERSION_ARGEO_COMMONS" $container
# Metadata
-buildah config --label name="argeo2-openjdk11-ubi8" $container
-buildah config --label summary="Argeo 2 Node based on OpenJDK 11 and Red Hat UBI 8" $container
-
-# Required as long as we declare an 'argeo' user
-buildah run $container -- microdnf install shadow-utils
+buildah config --label name="argeo2-node" $container
+buildah config --label description="Argeo 2 Node" $container
+buildah config --label url=https://hub.docker.com/repository/docker/argeo/argeo2-node $container
# Argeo Node
-buildah run $container -- microdnf install argeo-cms-e4-rap argeo-node
+buildah run $container -- microdnf install osgi-boot argeo-cms-e4-rap argeo-node
+buildah run $container -- microdnf clean all
+
+#buildah run $container -- rm -rf /srv/rpmfactory/argeo-osgi-2
# Configuration
buildah config --entrypoint '["/usr/sbin/argeoctl","start"]' $container
buildah config --port 8080 $container
-buildah commit $container argeo2-node:latest
+buildah commit --rm --format docker $container argeo/argeo2-node:$VERSION_ARGEO_COMMONS-$ARCH
+buildah tag argeo/argeo2-node:$VERSION_ARGEO_COMMONS-$ARCH argeo/argeo2-node:$ARCH
+
+buildah push argeo/argeo2-node:$VERSION_ARGEO_COMMONS-$ARCH docker://argeo/argeo2-node:$VERSION_ARGEO_COMMONS-$ARCH
+buildah push argeo/argeo2-node:$ARCH docker://argeo/argeo2-node:$ARCH