summaryrefslogtreecommitdiffstats
path: root/redhat/docker/mageia32.sh
blob: 01aa1f6724b85e0b8c64d228edc9f905915b5e2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

NAME="mageia32"
VERSION="$1" # E.g: '26'
IMAGE="${NAME}:${VERSION}"
TAR="${NAME}-${VERSION}.tar"
INSTALLROOT="/dev/shm/${IMAGE}"

sudo rm -rf "${INSTALLROOT}"
sudo mkdir -p "${INSTALLROOT}"
setarch i686 sudo urpmi \
  --root="${INSTALLROOT}" \
  --auto \
  bash vim urpmi mageia-release-common

sudo tar -C "${INSTALLROOT}" -c . >"${TAR}"
sudo rm -rf "${INSTALLROOT}"

docker rmi -f "${IMAGE}"
docker import "${TAR}" "${IMAGE}"