From 3bb850f6c265f37a8b498d11bbc0f006665bc779 Mon Sep 17 00:00:00 2001 From: Nikolai-Hlubek Date: Tue, 2 May 2023 11:03:53 +0200 Subject: [PATCH 1/2] Added dockerfile to build STM32F427 binary --- example/renode/Dockerfile | 22 ++++++++++++++++++++++ example/renode/README.md | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 example/renode/Dockerfile create mode 100644 example/renode/README.md diff --git a/example/renode/Dockerfile b/example/renode/Dockerfile new file mode 100644 index 00000000..09a2f522 --- /dev/null +++ b/example/renode/Dockerfile @@ -0,0 +1,22 @@ +FROM debian:11.5-slim + +RUN apt-get update --yes && \ + apt-get upgrade --yes && \ + apt-get install --yes --no-install-recommends \ + ca-certificates \ + build-essential \ + git python gcc gcc-arm-none-eabi libnewlib-arm-none-eabi \ + vim \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + + +RUN useradd --create-home -d /home/tiny --shell /bin/bash --password tiny tiny +USER tiny +WORKDIR /home/tiny + +COPY --chown=tiny:tiny renode ./renode + +WORKDIR /home/tiny/renode +RUN make diff --git a/example/renode/README.md b/example/renode/README.md new file mode 100644 index 00000000..3da1f348 --- /dev/null +++ b/example/renode/README.md @@ -0,0 +1,18 @@ +# Docker build container + + +## Build renode minimal example + +Create a minimal docker image that contains everything to build +the binary. The binary is build during the creation of the image. + +> docker build --progress=plain -t renode . + + +## Get example to host + +Start the container with +> docker run --mount src="$(pwd)",target=/mnt,type=bind -it renode /bin/bash + +In the container go into folder renode and copy the build binary to the host. +> cp renode-example.elf /mnt From 0bb466ededb804f04bd38ee3e22c442b47ea161e Mon Sep 17 00:00:00 2001 From: Nikolai-Hlubek Date: Tue, 2 May 2023 11:14:41 +0200 Subject: [PATCH 2/2] Bugfix: Make docker run from original folder structure --- example/renode/Dockerfile | 2 +- example/renode/README.md | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/example/renode/Dockerfile b/example/renode/Dockerfile index 09a2f522..39a8976e 100644 --- a/example/renode/Dockerfile +++ b/example/renode/Dockerfile @@ -16,7 +16,7 @@ RUN useradd --create-home -d /home/tiny --shell /bin/bash --password tiny tiny USER tiny WORKDIR /home/tiny -COPY --chown=tiny:tiny renode ./renode +COPY --chown=tiny:tiny . ./renode WORKDIR /home/tiny/renode RUN make diff --git a/example/renode/README.md b/example/renode/README.md index 3da1f348..b5dd04ae 100644 --- a/example/renode/README.md +++ b/example/renode/README.md @@ -1,7 +1,12 @@ -# Docker build container +# Renode example +https://interrupt.memfault.com/blog/intro-to-renode -## Build renode minimal example + +## Docker build container + + +### Build renode minimal example Create a minimal docker image that contains everything to build the binary. The binary is build during the creation of the image. @@ -9,7 +14,7 @@ the binary. The binary is build during the creation of the image. > docker build --progress=plain -t renode . -## Get example to host +### Get example to host Start the container with > docker run --mount src="$(pwd)",target=/mnt,type=bind -it renode /bin/bash