diff options
author | nachoparker <nacho@ownyourbits.com> | 2019-07-02 04:15:46 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2019-07-06 06:43:54 +0300 |
commit | 35526ab9fcfc538b68a10bbf449d6b1fe5ea7d6d (patch) | |
tree | bf5f7762937f0fd38bb7463041e25726cc74bd16 /build-docker.sh | |
parent | 88da901eddff125b3e71d9706fbe02edffc659b3 (diff) |
build: use a system wide config file. Remove sury sources
Signed-off-by: nachoparker <nacho@ownyourbits.com>
Diffstat (limited to 'build-docker.sh')
-rwxr-xr-x | build-docker.sh | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/build-docker.sh b/build-docker.sh index 423d12bb..40fd70ce 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -8,29 +8,31 @@ set -e version=$(git describe --tags --always) version=${version%-*-*} +release=$(jq -r .release < etc/ncp.cfg) function docker_build() { DOCKER_BUILDKIT=1 docker build --progress=plain . "$@"; } function build_arch() { - local arch="${1}" - local arch_qemu="${2}" - local ncp_tag="${3:-$arch}" - - docker_build -f docker/debian-ncp/Dockerfile -t ownyourbits/debian-ncp-${arch}:latest --pull --build-arg arch=${arch} --build-arg arch_qemu=${arch_qemu} - docker_build -f docker/lamp/Dockerfile -t ownyourbits/lamp-${arch}:latest --build-arg arch=${arch} - docker_build -f docker/nextcloud/Dockerfile -t ownyourbits/nextcloud-${arch}:latest --build-arg arch=${arch} - docker_build -f docker/nextcloudpi/Dockerfile -t ownyourbits/nextcloudpi-${arch}:latest --build-arg arch=${arch} - - docker tag ownyourbits/debian-ncp-${arch}:latest ownyourbits/debian-ncp-${ncp_tag}:"${version}" - docker tag ownyourbits/lamp-${arch}:latest ownyourbits/lamp-${ncp_tag}:"${version}" - docker tag ownyourbits/nextcloud-${arch}:latest ownyourbits/nextcloud-${ncp_tag}:"${version}" - docker tag ownyourbits/nextcloudpi-${arch}:latest ownyourbits/nextcloudpi-${ncp_tag}:"${version}" + local release="${1}" + local arch="${2}" + local arch_qemu="${3}" + local ncp_tag="${4:-$arch}" + + docker_build -f docker/debian-ncp/Dockerfile -t ownyourbits/debian-ncp-${ncp_tag}:latest --pull --build-arg release=${release} --build-arg arch=${arch} --build-arg arch_qemu=${arch_qemu} + docker_build -f docker/lamp/Dockerfile -t ownyourbits/lamp-${ncp_tag}:latest --build-arg release=${release} --build-arg arch=${ncp_tag} + docker_build -f docker/nextcloud/Dockerfile --no-cache -t ownyourbits/nextcloud-${ncp_tag}:latest --build-arg release=${release} --build-arg arch=${ncp_tag} + docker_build -f docker/nextcloudpi/Dockerfile -t ownyourbits/nextcloudpi-${ncp_tag}:latest --build-arg release=${release} --build-arg arch=${ncp_tag} --build-arg ncp_ver=${version} + + docker tag ownyourbits/debian-ncp-${ncp_tag}:latest ownyourbits/debian-ncp-${ncp_tag}:"${version}" + docker tag ownyourbits/lamp-${ncp_tag}:latest ownyourbits/lamp-${ncp_tag}:"${version}" + docker tag ownyourbits/nextcloud-${ncp_tag}:latest ownyourbits/nextcloud-${ncp_tag}:"${version}" + docker tag ownyourbits/nextcloudpi-${ncp_tag}:latest ownyourbits/nextcloudpi-${ncp_tag}:"${version}" } -[[ "$@" =~ "x86" ]] && build_arch amd64 x86_64 x86 -[[ "$@" =~ "armhf" ]] && build_arch armhf arm -[[ "$@" =~ "arm64" ]] && build_arch arm64v8 aarch64 arm64 +[[ "$@" =~ "x86" ]] && build_arch "${release}" amd64 x86_64 x86 +[[ "$@" =~ "armhf" ]] && build_arch "${release}" arm32v7 arm armhf +[[ "$@" =~ "arm64" ]] && build_arch "${release}" arm64v8 aarch64 arm64 # License |