Skip to content

Commit f8cdcd3

Browse files
committed
SWPROT-8953: docker: Run zpc in container (SiliconLabsSoftware#41)
Since the port is exposed, the user can interact with mosquitto clients ouside the container. mosquitto_sub -t '#' Not this feature is not explicilty supported at the moment, but it can be useful for validation purposes. Origin: SiliconLabsSoftware#41 Signed-off-by: Philippe Coval <[email protected]>
1 parent ec09791 commit f8cdcd3

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

.dockerignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# .dockerignore
2+
Dockerfile
3+
docker-compose.yml
4+
5+
# .gitignore
6+
# Temporary files
7+
*~
8+
tmp
9+
# All build folders
10+
/build*/
11+
# Visual Studio Code
12+
.vscode/settings.json
13+
.vscode/launch.json
14+
.vscode/*.log
15+
*.code-workspace
16+
# JetBrains IDE
17+
.idea/
18+
# Cmake Projects in root ###
19+
compile_commands.json
20+
# Clangd index
21+
.clangd/
22+
.cache/
23+
# BeyondCompare backup files
24+
*.orig
25+
# SonarScanner files
26+
.scannerwork/
27+
# Generated debconf files
28+
applications/*/debconf/config
29+
# Macos fs igores
30+
*.DS_Store
31+
# Other files
32+
*.swp
33+
*.gcov

Dockerfile

+9-2
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,12 @@ RUN echo "# log: Build" \
3434
&& ./helper.mk \
3535
&& date -u
3636

37-
ENTRYPOINT [ "/usr/local/opt/z-wave-protocol-controller/helper.mk" ]
38-
CMD [ "help" ]
37+
RUN echo "# log: Install to system" \
38+
&& set -x \
39+
&& sudo dpkg -i ./build/${project}_*/*.deb \
40+
|| sudo apt install -f \
41+
&& sudo apt-get install -y mosquitto \
42+
&& date -u
43+
44+
ENTRYPOINT [ "/usr/bin/zpc" ]
45+
CMD [ "--help" ]

docker-compose.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- coding: utf-8 -*-
2+
# SPDX-License-Identifier: ZLib
3+
4+
version: "2"
5+
6+
services:
7+
broker:
8+
image: eclipse-mosquitto:1.5.9
9+
ports:
10+
- '1883:1883'
11+
command: mosquitto
12+
restart: unless-stopped
13+
14+
zpc:
15+
build: .
16+
command: run --mqtt.host=broker
17+
devices:
18+
- ${DEVICE:-/dev/ttyACM0}:/dev/ttyUSB0
19+
depends_on:
20+
- broker
21+
restart: on-failure

0 commit comments

Comments
 (0)