eclipse-velocitas / vehicle-app-python-sdk

vehicle-app-python-sdk
Apache License 2.0
7 stars 18 forks source link

[Bug]: Seat Adjuster Dockerfile is not buildable "stand-alone" #84

Open mikehaller opened 1 year ago

mikehaller commented 1 year ago

What happened?

When trying to build the Seat Adjuster example using the provided Dockerfile, it fails due to a missing folder. The folder ./app does not exist in the repository.

Operating System

Linux

What release version or branch did you use?

v0.9.0

Relevant log output

$ docker build https://github.com/eclipse-velocitas/vehicle-app-python-sdk.git#v0.9.0:examples/seat-adjuster
[+] Building 3.6s (6/16)                                                                                                                                                        
 => [internal] load git source https://github.com/eclipse-velocitas/vehicle-app-python-sdk.git#v0.9.0:examples/seat-adjuster                                               1.8s
 => [internal] load metadata for docker.io/library/python:3.10-slim-bullseye@sha256:1ee6094f44c67781fa9533a4215f44f80dd3f43a68751ad2c855712116c03b05                       1.7s 
 => [auth] library/python:pull token for registry-1.docker.io                                                                                                              0.0s 
 => [builder  1/10] FROM docker.io/library/python:3.10-slim-bullseye@sha256:1ee6094f44c67781fa9533a4215f44f80dd3f43a68751ad2c855712116c03b05                               0.2s 
 => => resolve docker.io/library/python:3.10-slim-bullseye@sha256:1ee6094f44c67781fa9533a4215f44f80dd3f43a68751ad2c855712116c03b05                                         0.2s 
 => CACHED [builder  2/10] RUN apt-get update && apt-get install -y binutils                                                                                               0.0s
 => ERROR [builder  3/10] COPY ./app /app                                                                                                                                  0.0s
------
 > [builder  3/10] COPY ./app /app:
------
Dockerfile:22
--------------------
  20 |     RUN apt-get update && apt-get install -y binutils
  21 |     
  22 | >>> COPY ./app /app
  23 |     
  24 |     # Remove this installation for Arm64 once staticx has a prebuilt wheel for Arm64
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref moby::eqy6el1uiuv39ll6w2awkcg3g: "/app": not found

Code of Conduct

BjoernAtBosch commented 1 year ago

85 provides just a quick fix: It makes the Dockerfile buildable from devContainer of vehicle-app-python-template (and instances of it).

The final fix shall make the Dockerfile buildable "standalone", means it shall not rely on temporary artefacts created by prerequisite build steps outside the Dockerfile.

BjoernAtBosch commented 1 year ago

The Dockerfile of the seat-adjuster example contains a copy statement for the ./app folder and for the vehicle model to make it available in the created container. This copy statement presumes a build step outside the Dockerfile, which is not (necessarily) done if the image build is just referring to the Dockerfile.

Dockerfiles shall be buildable "stand-alone", i.e. without requiring a devContainer where the container needs to be done.

This bug relates to https://github.com/eclipse-velocitas/vehicle-app-python-template/issues/162