Hello World in IoT i.e Blinky - boot to desktop tutorial [7 of 9]

Play Hello World in IoT i.e Blinky - boot to desktop tutorial [7 of 9]

The Discussion

  • User profile image
    rlizano
    Great introduction to Docker. I had no idea it was this easy! In fact, it's pretty cool!!
  • User profile image
    Jeroen

    Nice introduction.
    If I run the example code in Docker on the Raspberry Pi 4, I get the error "Unhandled exception. System.IO.IOException: Read-only file system"
    If I don't run it in a container (headless mode, video 6) it works.

    Any suggestions?

  • User profile image
    Andreas

    Hm, getting always this error:

    pi@raspberrypi:~/Blink-Docker $ docker build -t blink .
    Sending build context to Docker daemon 5.632kB
    Step 1/11 : FROM microsoft/dotnet:2.1-sdk-stretch AS build
    2.1-sdk-stretch: Pulling from microsoft/dotnet
    7919f5b7d602: Pull complete
    0e107167dcc5: Pull complete
    66a456bba435: Pull complete
    5435318a0426: Pull complete
    76e8fe87b86e: Pull complete
    d2918e01490a: Pull complete
    72d75fd1a069: Pull complete
    Digest: sha256:2573a98403187e5a1f9cf7cd1f00f44f4626eea8cd84cde0490153dad1cb4efa
    Status: Downloaded newer image for microsoft/dotnet:2.1-sdk-stretch
    ---> 37700dbfad93
    Step 2/11 : WORKDIR /app
    ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
    ---> Running in b9bd5a7f9949
    Removing intermediate container b9bd5a7f9949
    ---> 7cf6497073ed
    Step 3/11 : COPY *.config .
    COPY failed: no source files were specified

  • User profile image
    PhilW

    @Andreas you need to update the Dockerfile to the latest repo and make sure it's for ARM

    I updated to arm64 because I am running Ubuntu on my Pi, you probably want to use arm32 if you are using Pi OS. You will then be at the same place as @Jeroen and me!

    Replace:
    FROM microsoft/dotnet:2.1-sdk-stretch AS build

    With:
    ARG REPO=mcr.microsoft.com/dotnet/sdk
    FROM $REPO:5.0-buster-slim-arm64v8 AS build

    Replace:
    FROM microsoft/dotnet:2.1-runtime-stretch-slim-arm32v7 AS runtime

    With:
    FROM $REPO:5.0-buster-slim-arm64v8 AS runtime



  • User profile image
    PhilW

    @Jeroen Actually after posting just now, this works for me.

    $ docker run --privileged blink

    However be aware of possible security issues: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities

    Not sure why --device /dev/gpiomem is not working.

Add Your 2 Cents