-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild-and-run-image.sh
executable file
·34 lines (31 loc) · 1.09 KB
/
build-and-run-image.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
# file used for local development
# local build and run
omnect_ui_version=$(toml get --raw Cargo.toml package.version)
rust_version="1.84.1-bookworm"
omnect_ui_port="1977"
centrifugo_port="8000"
docker build \
--build-arg=DOCKER_NAMESPACE=omnectweucopsacr.azurecr.io \
--build-arg=VERSION_RUST_CONTAINER="${rust_version}" \
--build-arg=OMNECT_UI_BUILD_ARG="--features=mock" \
-f Dockerfile \
--progress=plain \
-t omnect-ui-x86:"local_${omnect_ui_version}" .
# ensure presence of:
# /tmp/api.sock (normally created by a local instance of omnect-device-service)
# ./temp/cert.pem and ./temp/key.pem (certificate and key file)
docker run --rm \
-v $(pwd)/temp:/cert \
-v /tmp:/socket \
-v $(pwd)/temp/data:/data \
-u $(id -u):$(id -g) \
-e RUST_LOG=debug \
-e UI_PORT=1977 \
-e SOCKET_PATH=/socket/api.sock \
-e CENTRIFUGO_ADMIN_ENABLED=true \
-e CENTRIFUGO_ADMIN_PASSWORD=123 \
-e CENTRIFUGO_ADMIN_SECRET=123 \
-e DATA_DIR_PATH=/data \
-p "${omnect_ui_port}":"${omnect_ui_port}" \
-p "${centrifugo_port}":"${centrifugo_port}" \
omnect-ui-x86:"local_${omnect_ui_version}"