Commit Graph
10 Commits
Author SHA1 Message Date
SZEDER Gábor e75f7455c4 Dockerfile: generate autogen/version.c only once
Since c5720564 (Force version to be regenerated on each compile,
2021-06-01) `autogen/version.c` must be generated during the build
process, but the build instructions in the `Dockerfile` have not been
updated accordingly.  Since then two commits [1] on separate branches
updated `Dockerfile` to deal with the missing file, and now
`autogen/version.c` is generated twice during a containerized build.

Remove all redundant commands from `Dockerfile`'s `CMD` instruction to
generate `autogen/version.c` and its subdirectory only once.

[1] 8e9745a6 (Add version.c generation to dockerbuild and actions,
              2021-11-02)
    7f013d6d (Fixed dockerbuild.sh, now run as user (instead
              of root) and fixed the autogeneration of version.c,
              2021-09-16)
2022-02-20 20:25:08 +01:00
SZEDER Gábor 22226faef4 Dockerfile: avoid caching issues with apt-get update and install
The `Dockerfile` uses separate `RUN` instructions for each `apt-get`
command.  Docker's documentation considers this as an anti-pattern,
because it can lead to caching issues [1].

Follow Docker's advice, and combine all `apt-get` invocations into a
single `RUN` instruction with an &&-chaned list of commands.  This
makes it rather hard to tell which command produces which output, so
insert a `set -x` at the beginning of the command chain to generate a
trace of the executed commands.

[1] Each `RUN` instruction, including subsequent `RUN apt-get update`
    and `RUN apt-get install` instructions create separate layers that
    are stored in the Docker cache.  If someone were to modify the
    list of list of packages to install, then Docker would re-use the
    layer created by the prior `RUN apt-get update` instruction,
    meaning that `apt-get install` would use an outdate package list.
    This can lead to outdated packages to be installed, or a failure
    if the outdated version is not present anymore in the package
    repository.

    https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
2022-02-20 19:34:48 +01:00
Paul Guenette fbb9dd4a9a Merge branch 'master' into devel 2021-11-20 13:12:14 -05:00
Aleksandr 8e9745a652 Add version.c generation to dockerbuild and actions 2021-11-02 15:21:21 +03:00
pbrier 7f013d6d0b Fixed dockerbuild.sh, now run as user (instead of root) and fixed the autogeneration of version.c 2021-09-16 10:27:48 +02:00
Aaron de los Santos 319a9df4f6 Renamed enums.h to ODriveEnums.h 2021-06-11 17:32:43 -07:00
Aaron de los Santos 2e36ac14c1 Update makefile to generate new arduino enums file
Added command to makefile to generate enums.h for Arduino use. Did the same for the dockerfile. Added note on developer-guide markdown file to also update enums.h along with enums.py.
2021-06-11 17:05:33 -07:00
InNoobWeTrust e7f5f907ad Update docker build for v0.5.1
- Docker image now only contain the build environment, not the code.
  This save development time by not rebuilding docker image everytime
  source code change.
- Build by mounting repo's directory into container, build output and
  intermediate artifacts is available for inspecting if build fail
  midway.
2020-09-15 19:17:43 +07:00
Brandon Lewis c34cf83c63 Use the tag for the specific LTS release 2020-01-29 18:21:23 -08:00
Brandon Lewis 73a167272c Add a Dockerfile which builds in an Ubuntu container 2020-01-29 18:21:23 -08:00