-
-
Save zonggen/0050a3d99e0ed4c378333f65adf2ea04 to your computer and use it in GitHub Desktop.
Quick start on CoreOS Assembler and Fedora CoreOS
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
#!/usr/bin/env bash | |
# this script will use podman, but docker will work too | |
rpm -qa | grep -q podman || (echo "podman not installed!" ; exit 1) | |
# checks if cosa image was pulled previously | |
podman image exists quay.io/coreos-assembler/coreos-assembler || \ | |
podman pull quay.io/coreos-assembler/coreos-assembler | |
# create a tmp directory for storing builds | |
mkdir -p fcos && cd fcos | |
# define the _real_ cosa command | |
# https://github.com/coreos/coreos-assembler#define-a-bash-alias-to-run-cosa | |
cosa() { | |
env | grep COREOS_ASSEMBLER | |
set -x | |
podman run --rm -ti --security-opt label=disable --privileged \ | |
--uidmap=1000:0:1 --uidmap=0:1:1000 --uidmap 1001:1001:64536 \ | |
-v ${PWD}:/srv/ --device /dev/kvm --device /dev/fuse \ | |
--tmpfs /tmp -v /var/tmp:/var/tmp --name cosa \ | |
${COREOS_ASSEMBLER_CONFIG_GIT:+-v $COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro} \ | |
${COREOS_ASSEMBLER_GIT:+-v $COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:ro} \ | |
${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \ | |
${COREOS_ASSEMBLER_CONTAINER:-quay.io/coreos-assembler/coreos-assembler:latest} "$@" | |
rc=$?; set +x; return $rc | |
} | |
# run the cosa container and run shell | |
cosa shell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instruction for building a FCOS image: