forked from eclipse-sw360/sw360
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_build.sh
executable file
·40 lines (32 loc) · 1.24 KB
/
docker_build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash -x
# -----------------------------------------------------------------------------
# Copyright BMW CarIT GmbH 2021
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# This script is executed on startup of Docker container.
# (execution of docker run cmd) starts couchdb and tomcat.
# -----------------------------------------------------------------------------
set -e
GIT_ROOT=$(git rev-parse --show-toplevel)
# Download dependencies outside container
"$GIT_ROOT"/scripts/docker-config/download_dependencies.sh
# To avoid excessive copy, we will export the git archive of the sources to deps
git archive --output=deps/sw360.tar --format=tar --prefix=sw360/ HEAD
COMPOSE_DOCKER_CLI_BUILD=1
DOCKER_BUILDKIT=1
export DOCKER_BUILDKIT COMPOSE_DOCKER_CLI_BUILD
[ -n "$FOSSOLOGY" ] && extra_args="-f $GIT_ROOT/fossology-docker-compose.yml"
[ -n "$VERBOSE" ] && docker_verbose="--progress=plain"
#shellcheck disable=SC2086
docker-compose \
--file "$GIT_ROOT"/docker-compose.yml \
$extra_args \
build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
$docker_verbose \
"$@"