Skip to content

Instantly share code, notes, and snippets.

@FilBot3
Created May 4, 2022 13:15
Show Gist options
  • Save FilBot3/f1c1ab410ec22cd3d235430dc8902519 to your computer and use it in GitHub Desktop.
Save FilBot3/f1c1ab410ec22cd3d235430dc8902519 to your computer and use it in GitHub Desktop.
A trivial, simple example of how to use Buildah to build a Container Image.
#!/usr/bin/env bash
container=$(buildah from docker.io/library/ubuntu)
buildah run ${container} -- sh -c "apt update && apt install --yes curl apt-transport-https ca-certificates"
buildah run ${container} -- sh -c "apt update && apt install --yes vim"
buildah config --entrypoint="/bin/bash" ${container}
buildah config --cmd="--login -i" ${container}
buildah commit ${container} localhost/ubuntu-vim:latest
buildah images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment