Skip to content

Instantly share code, notes, and snippets.

@sallyom
Last active July 12, 2018 20:41
Show Gist options
  • Save sallyom/af68d771a3ff05e064b0bfbe65191e9e to your computer and use it in GitHub Desktop.
Save sallyom/af68d771a3ff05e064b0bfbe65191e9e to your computer and use it in GitHub Desktop.
demo install mongoose in image with buildah mnt
#! /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