diff --git a/Makefile b/Makefile index 5eeba29..1002927 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,7 @@ -.PHONY: all images +all: build_ubuntu -all: Dockerfile +.PHONY: all -Dockerfile: Dockerfile.solution templates/*.in SOLUTION MANIFEST +build_ubuntu: Dockerfile.solution templates/*.in SOLUTION MANIFEST @scripts/build-dockerfile - -images: - @scripts/build-images + @scripts/build-images \ No newline at end of file diff --git a/scripts/build-dockerfile b/scripts/build-dockerfile index 5b3ee46..118b5d7 100755 --- a/scripts/build-dockerfile +++ b/scripts/build-dockerfile @@ -2,8 +2,15 @@ # Bring in the variables from SOLUTION file # -export $(grep -v '^#' SOLUTION | xargs -d '\n') -export $(grep -v '^#' MANIFEST | xargs -d '\n') +# Determine if it is Mac OS and switch to use gxargs instead +CMD=xargs +if [ $(which system_profiler) ]; then + CMD=gxargs +fi + +export $(grep -v '^#' SOLUTION | ${CMD} -d '\n') +export $(grep -v '^#' MANIFEST | ${CMD} -d '\n') + # Remove the Dockerfile if it exists; should check # if it is clean first, and abort if not. diff --git a/scripts/build-images b/scripts/build-images index cae9156..416e0bd 100755 --- a/scripts/build-images +++ b/scripts/build-images @@ -2,8 +2,15 @@ # Bring in the variables from SOLUTION file # -export $(grep -v '^#' SOLUTION | xargs -d '\n') -export $(grep -v '^#' MANIFEST | xargs -d '\n') +# Determine if it is Mac OS and switch to use gxargs instead +CMD=xargs +if [ $(which system_profiler) ]; then + CMD=gxargs +fi + +export $(grep -v '^#' SOLUTION | ${CMD} -d '\n') +export $(grep -v '^#' MANIFEST | ${CMD} -d '\n') + docker build . -t ${CONTAINER}:agama-${AGAMA_VERSION} || { cat << EOM diff --git a/scripts/clean-image.sh b/scripts/clean-image.sh index 4b8905e..02dc09d 100755 --- a/scripts/clean-image.sh +++ b/scripts/clean-image.sh @@ -2,7 +2,13 @@ # Bring in the variables from SOLUTION file # -export $(grep -v '^#' SOLUTION | xargs -d '\n') -export $(grep -v '^#' MANIFEST | xargs -d '\n') +# Determine if it is Mac OS and switch to use gxargs instead +CMD=xargs +if [ $(which system_profiler) ]; then + CMD=gxargs +fi + +export $(grep -v '^#' SOLUTION | ${CMD} -d '\n') +export $(grep -v '^#' MANIFEST | ${CMD} -d '\n') docker rmi ${REPO_URL}/${CONTAINER}:devel