Skip to content

Instantly share code, notes, and snippets.

@jcollie
Created August 20, 2016 17:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jcollie/45ae3e282d6528b6d586d801c14cd886 to your computer and use it in GitHub Desktop.
script for building fedora appc container
#!/bin/bash
#
# Download Fedora Docker base image from:
# https://getfedora.org/en/cloud/download/docker.html
#
set -e
version=0.1
tmp1=`mktemp -d`
tmp2=`mktemp -d`
tarEnd() {
export EXIT=$?
rm -rf $tmp1 $tmp2 && exit $EXIT
}
trap tarEnd EXIT
tar --extract --file Fedora-Docker-Base-24-1.2.x86_64.tar.xz --directory $tmp1
tar --extract --file $tmp1/*/layer.tar --directory $tmp2
acbuild --debug begin $tmp2
acbuildEnd() {
export EXIT=$?
rm -rf $tmp1 $tmp2
acbuild --debug end && exit $EXIT
}
trap acbuildEnd EXIT
acbuild --debug set-name ocjtech.us/fedora24
acbuild --debug label add version ${version}
acbuild --debug run -- rpm --rebuilddb
acbuild --debug run -- dnf -y update --refresh
acbuild --debug run -- dnf clean all
acbuild --debug run -- rpm --rebuilddb
acbuild --debug run -- rm -f /etc/resolv.conf
acbuild --debug write --overwrite fedora24-${version}.aci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment