summaryrefslogtreecommitdiffstats
path: root/cam/Dockerfile
blob: bdae480071697638d107a29cbcf1b7934050fa47 (plain) (blame)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
###############################################################################
#        Copyright (C) 2020        Sebastian Francisco Colomar Bauza          #
#        Copyright (C) 2020        Alejandro Colomar Andrés                   #
#        SPDX-License-Identifier:  GPL-2.0-only                               #
###############################################################################

FROM	debian@sha256:e6a6f2625ec46aa6ce5c537208565cde16138e7963c341ff2a3ecbf9a6736060 \
			AS build
RUN	apt-get update							&& \
	apt-get upgrade -V --yes					&& \
	apt-get install -V \
			gcc \
			gcc-10 \
			g++ \
			g++-10 \
			make \
			git \
			pkg-config \
			libbsd-dev \
			libgsl-dev \
			libopencv-dev \
			deborphan \
			--yes						&& \
	apt-get autoremove --purge --yes				&& \
	apt-get purge $(deborphan) --yes				&& \
	apt-get autoclean						&& \
	apt-get clean
WORKDIR	/tmp
RUN	git clone							\
	    --single-branch						\
	    --branch v1.0-b23						\
	    https://github.com/alejandro-colomar/libalx.git		&& \
	make	base cv				-C libalx	-j 8	&& \
	make	install-base install-cv		-C libalx
RUN	git clone							\
	    --single-branch						\
	    --branch version-0.5					\
	    https://github.com/alejandro-colomar/rob_cam.git		&& \
	make	-C rob_cam/cam/	-j 2

FROM	debian@sha256:e6a6f2625ec46aa6ce5c537208565cde16138e7963c341ff2a3ecbf9a6736060
RUN	apt-get update							&& \
	apt-get upgrade --yes						&& \
	apt-get install -V \
			make \
			libc6 \
			libstdc++6 \
			libbsd0 \
			libgsl23 \
			libgslcblas0 \
			libopencv-core4.2 \
			libopencv-videoio4.2 \
			libopencv-dev \
			--yes						&& \
	apt-get autoremove --purge --yes				&& \
	apt-get autoclean						&& \
	apt-get clean
WORKDIR	/tmp
COPY	--from=build /tmp/libalx ./libalx
RUN	make	install-base install-cv		-C libalx
WORKDIR	/app
COPY	--from=build /tmp/rob_cam/cam/cam ./
RUN	chmod +x ./cam
CMD	["./cam"]

# docker container run --tty --interactive --rm --name cam --network rob_cam_network --device="/dev/video0:/dev/video0" --env ROB_ADDR=rob --env ROB_PORT=13100 --env CAMERA_IDX=0 --env DELAY_US=10000 alejandrocolomar/rob_cam:cam_0.5.6