-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·49 lines (42 loc) · 975 Bytes
/
build.sh
File metadata and controls
executable file
·49 lines (42 loc) · 975 Bytes
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
41
42
43
44
45
46
47
48
49
#!/bin/bash
set -exo pipefail
if [ -z "$BUILD_TAG" ]; then
export BUILD_TAG=odoo:${VERSION}
fi
#
# Build the image
#
# Normally run by the Makefile:
#
# $ make VERSION=$VERSION build
#
# It expects the following variables to be set:
#
# * VERSION (16.0, 17.0, ...)
# * BUILD_TAG (tag of the 'latest' image built)
#
if [ -z "$VERSION" ]; then
echo "VERSION environment variable is missing"
exit 1
fi
case "$VERSION" in
"14.0")
PYTHON_FROM="python:3.9-slim-trixie"
;;
*)
PYTHON_FROM="python:3.12-slim-trixie"
;;
esac
TMP=$(mktemp -d)
echo "Working in $TMP"
on_exit() {
echo "Cleaning up temporary directory..."
rm -rf $TMP
rm -f /tmp/odoo.tar.gz
}
trap on_exit EXIT
SRC=${TMP} . ./setup.sh
docker build --progress plain --no-cache \
--build-arg VERSION=${VERSION} \
--build-context python=docker-image://${PYTHON_FROM} \
-f ${TMP}/Dockerfile -t ${BUILD_TAG} ${TMP}