File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# !/bin/echo run with: docker build . -f
22# -*- coding: utf-8 -*-
33
4- FROM arm32v7/debian:stretch AS base
5- ENV target_debian_arch=armhf
4+ ARG ARCH=arm32v7
5+ ARG TARGET_DEBIAN_ARCH=armhf
6+
7+ FROM docker.io/${ARCH}/debian:stretch AS base
8+ ARG TARGET_DEBIAN_ARCH=armhf
9+ ENV target_debian_arch=${TARGET_DEBIAN_ARCH}
610
711LABEL maintainer="Laudin Molina Troconis <laudin.molinatroconis@silabs.com>"
812
Original file line number Diff line number Diff line change 22
33services :
44 dev :
5- image : zipgateway-dev
5+ image : zipgateway-dev-${ARCH:-arm32v7}
66 build :
77 context : .
88 target : dev
9+ args :
10+ ARCH : ${ARCH:-arm32v7}
11+ TARGET_DEBIAN_ARCH : ${TARGET_DEBIAN_ARCH:-armhf}
912 volumes :
1013 - .:/usr/local/src/zipgateway
1114 working_dir : /usr/local/src/zipgateway
@@ -18,6 +21,9 @@ services:
1821 build :
1922 context : .
2023 target : runtime
24+ args :
25+ ARCH : ${ARCH:-arm32v7}
26+ TARGET_DEBIAN_ARCH : ${TARGET_DEBIAN_ARCH:-armhf}
2127 command : tests
2228 devices :
2329 - /dev/ttyACM0:/dev/ttyACM0
Original file line number Diff line number Diff line change @@ -11,10 +11,16 @@ default: help all
1111SELF? =${CURDIR}/helper.mk
1212sudo? =sudo
1313build_dir? =build
14+ compose? =docker-compose
1415
1516# TODO: adapt for arm and support 64bits
1617target_debian_arch? =$(shell dpkg --print-architecture || echo 'i386')
1718
19+ # Map Debian arch name to Docker image arch prefix
20+ docker_arch_armhf =arm32v7
21+ docker_arch_i386 =i386
22+ docker_arch? =$(docker_arch_${target_debian_arch} )
23+
1824packages? =make cmake time file git sudo
1925packages+ =build-essential pkg-config bison flex python
2026packages+ =libusb-1.0-0-dev libssl-dev libxml2-dev libjson-c-dev
@@ -130,8 +136,17 @@ tests: ${build_dir}
130136 cd ${build_dir} && ctest V=1
131137
132138docker-compose/up : docker-compose.yml
133- docker version
134- docker-compose --version
135- docker- compose up --build
139+ ${compose} -- version
140+ ARCH= ${docker_arch} TARGET_DEBIAN_ARCH= ${target_debian_arch} \
141+ ${ compose} up --build
136142
137143docker/run : docker-compose/up
144+
145+ docker/build/dev : docker-compose.yml
146+ ${compose} --version
147+ ARCH=${docker_arch} TARGET_DEBIAN_ARCH=${target_debian_arch} \
148+ ${compose} up dev --build
149+
150+ docker/run/dev : docker-compose.yml
151+ ARCH=${docker_arch} TARGET_DEBIAN_ARCH=${target_debian_arch} \
152+ ${compose} run dev
You can’t perform that action at this time.
0 commit comments