Skip to content

Instantly share code, notes, and snippets.

@emreozkangit
Last active March 28, 2019 05:55
Show Gist options
  • Save emreozkangit/05b3b10952f1a708475fe9c3b1045d13 to your computer and use it in GitHub Desktop.
Save emreozkangit/05b3b10952f1a708475fe9c3b1045d13 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -o errexit
# Hangi image'ı kullanacağını söylüyoruz
container=$(buildah from fedora:28)
buildah config --label maintainer="Emre Özkan <[email protected]>" $container
# Ftp ile dosyamızı container içine atıyoruz
curl -sSL http://ftpmirror.gnu.org/hello/hello-2.10.tar.gz -o hello-2.10.tar.gz
buildah copy $container hello-2.10.tar.gz /tmp/hello-2.10.tar.gz
buildah run $container dnf install -y tar gzip gcc make
buildah run $container dnf clean all
buildah run $container tar xvzf /tmp/hello-2.10.tar.gz -C /opt
# Hangi dizinde çalışması gerektiğini belirtiyoruz
buildah config --workingdir /opt/hello-2.10 $container
buildah run $container ./configure
buildah run $container make
buildah run $container make install
buildah run $container hello -v
buildah config --entrypoint /usr/local/bin/hello $container
# Son olarak bunu bir image haline getiriyoruz
buildah commit --format docker $container hello:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment