TexasInstruments / ti-docker-images

This repository provides a ubuntu 22.04 based docker image with all the packages that are required for Yocto Builds. The docker image can also be used to Install & Build via Top Level Makefile from sources for TI Arm based microprocessors
https://github.com/TexasInstruments/ti-docker-images/pkgs/container/ubuntu-distro
Other
1 stars 1 forks source link

Whitespace and lint errors and warnings #2

Open StaticRocket opened 3 months ago

StaticRocket commented 3 months ago

Dockerfile right now has an unexpected newline https://github.com/TexasInstruments/ti-docker-images/blob/ae2fe724cea5eea0b3c10687ddc2a98c0111d41f/ubuntu-distro/Dockerfile#L9

In addition to this the following warnings and errors were raised when running this Dockerfile through hadolint.

:5 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
-:5 DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
-:5 DL3015 info: Avoid additional packages by specifying `--no-install-recommends`
-:5 DL3013 warning: Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>`
-:16 DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check
-:16 DL3004 error: Do not use sudo as it leads to unpredictable behavior. Use a tool like gosu to enforce root

I'd ignore the package pinning messages given the nature of this container but still...

cshilwant commented 3 months ago

Hi @StaticRocket,

Fixing the following list of warnings looks acceptable :+1: ,

Other warnings I believe should be ignored. Following are my reasons,

StaticRocket commented 3 months ago

@cshilwant , heads up, I just went through a bunch of workflow optimizations related to docker here if you want to grab some useful components.

Specifically: cached builds using buildx are nice but they require some work to setup manually and some extra parameters need to be passed. These are especially useful if you want to run the workflow for every push and you plan on expanding the number of images.

Also your manual qemu setup should be replaced with a common action like docker/setup-qemu-action. But that's assuming you actually plan on building cross-arch images. Right now that doesn't appear to be the case...

But if you are only planning on building a 22.04 based image you can dramatically simplify your workflow to something like this: https://github.com/StaticRocket/psdk-doc-docker/blob/master/.github/workflows/docker.yml