-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
45 lines (23 loc) · 900 Bytes
/
Dockerfile.template
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
FROM bh.cr/gh_rahul_thakoor/yocto-builder-base-%%BALENA_ARCH%% as BUILD_BASE
ARG OS_REPOSITORY
ARG BOARD=%%BALENA_MACHINE_NAME%%
ARG BALENA_OS_VERSION
WORKDIR /src/app
RUN git clone -b ${BALENA_OS_VERSION} --recurse-submodules https://github.com/${OS_REPOSITORY} os-source
COPY --chown=build:build build.sh ./
RUN chmod u+x ./build.sh
COPY meta-balena-block meta-balena-block
USER build
RUN ./build.sh ${BOARD} balena-block ../../meta-balena-block/conf/samples
USER root
WORKDIR /usr/src/artifacts
RUN tar xf /src/app/block.tar.gz --directory /usr/src/artifacts && ls -l /usr/src/artifacts
RUN apt-get update && apt-get install -y tree
RUN tree /usr/src/artifacts
FROM balenalib/%%BALENA_ARCH%%-alpine
WORKDIR /src/app
COPY --from=BUILD_BASE /usr/src/artifacts/ /in-tree-kernel-modules
RUN install_packages kmod
COPY start.sh ./
RUN chmod u+x ./start.sh
CMD ["sh","./start.sh"]