Last active
July 12, 2018 20:41
-
-
Save sallyom/af68d771a3ff05e064b0bfbe65191e9e to your computer and use it in GitHub Desktop.
demo install mongoose in image with buildah mnt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -x | |
ctr=$(buildah from scratch) | |
mnt=`buildah mount $ctr` | |
dnf install -y --installroot=$mnt mongoose --releasever=27 --disablerepo=* --enablerepo=fedora --enablerepo=updates | |
dnf clean all --installroot=$mnt | |
buildah unmount $ctr | |
buildah config --entrypoint=/usr/bin/mongoose $ctr | |
buildah commit $ctr mongoose-test | |
contID=`podman run -td mongoose-test` | |
ipAddress=`podman inspect $contID | awk -F ":" '/IPAddress\"/ {print $2}' | sed 's/"//g' | sed 's/,//g'` | |
curl $ipAddress:8080 | |
set +x | |
echo "run 'podman exec -it $contID /bin/bash' to see what's in this container" | |
echo "to cleanup run 'podman stop $contID; podman rm $contID'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment