summaryrefslogtreecommitdiffstats
path: root/redhat/docker/opensuse32.sh
diff options
context:
space:
mode:
Diffstat (limited to 'redhat/docker/opensuse32.sh')
-rwxr-xr-xredhat/docker/opensuse32.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/redhat/docker/opensuse32.sh b/redhat/docker/opensuse32.sh
new file mode 100755
index 000000000..a3b888c75
--- /dev/null
+++ b/redhat/docker/opensuse32.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+NAME="opensuse32"
+VERSION="$1" # E.g: '42.3'
+IMAGE="${NAME}:${VERSION}"
+INSTALLROOT="/dev/shm/${IMAGE}"
+
+sudo rm -rf "${INSTALLROOT}"
+sudo mkdir -p "${INSTALLROOT}"
+
+if [ "${VERSION}" = "tumbleweed" ]; then
+ URL="http://download.opensuse.org/tumbleweed"
+else
+ URL="http://download.opensuse.org/distribution/leap/${VERSION}"
+fi
+
+sudo zypper --root "${INSTALLROOT}" \
+ ar "${URL}/repo/oss/" "oss"
+sudo zypper --root "${INSTALLROOT}" \
+ ar "${URL}/repo/non-oss/" "non-oss"
+
+if [ "${VERSION}" != "tumbleweed" ]; then
+ sudo zypper --root "${INSTALLROOT}" \
+ ar "http://download.opensuse.org/update/leap/${VERSION}/oss/" "update-oss"
+ sudo zypper --root "${INSTALLROOT}" \
+ ar "http://download.opensuse.org/update/leap/${VERSION}/non-oss/" "update-non-oss"
+fi
+setarch i686 sudo zypper --root "${INSTALLROOT}" \
+ --gpg-auto-import-keys ref
+setarch i686 sudo zypper --root "${INSTALLROOT}" \
+ install -y bash vim zypper openSUSE-release
+
+sudo tar -C "${INSTALLROOT}" -c . >"${IMAGE}.tar"
+sudo rm -rf "${INSTALLROOT}"
+
+docker rmi -f "${IMAGE}"
+docker import "${IMAGE}.tar" "${IMAGE}"