ScottG489 / conjob

Simple web interface to run containers as jobs or serverless functions
MIT License
11 stars 0 forks source link

Follow docker best practices #1

Closed Knio closed 5 years ago

Knio commented 5 years ago

https://github.com/ScottG489/docker-ci-prototype/blob/ff77dac58e784a7e1cdd8314351bd7ed1931119f/Dockerfile#L3-L4

https://docs.docker.com/develop/develop-images/dockerfile_best-practices/

Always combine RUN apt-get update with apt-get install in the same RUN statement. Using apt get update alone in a RUN statement causes caching issues and subsequent apt-get install instructions fail.

ScottG489 commented 5 years ago

Hey Knio, thanks for the call out!

However, this project is just for prototyping as the name specifies ;)

Anyways, it's not great practice to use apt-get to install packages, especially with no version specified as I have done here. Ideally you'd want to be able to manage your container's dependencies directly so you can be sure you're getting the exact same program and version every time. This can be done, for instance, by curling a specific artifact and installing it yourself within the container.

Hope, this helped!