mirror of
https://github.com/docker/docs.git
synced 2026-03-27 06:18:55 +07:00
Optimize Dockerfile
This optimizes the Dockerfile a bit by;
- putting the docs archives at the top to
optimize caching and to prevent having
to clone the github repository on each
build. Note that '--no-cache' is needed
to forcefully break the cache, but the
archives should not frequently change
- grouping RUN lines to reduce image size.
- using a loop for the archived versions to
reduce the amount of duplicated code.
- using the local files for the *current*
version of the docs instead of the git
clone from GitHub. this makes it also
use the right source instead of "master"
- adding a .dockerignore to prevent busting
the cache if not needed, and to prevent
uploading the '.git' repository, which
is not used for the "current" docs
Difference in size before/after;
REPOSITORY TAG IMAGE ID CREATED SIZE
docs latest 36f6ad029e6a 3 minutes ago 1.722 GB
docs-orig latest 4f1a3e3fda4f 16 minutes ago 3.344 GB
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
||||
.dockerignore
|
||||
.git
|
||||
.gitignore
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
Reference in New Issue
Block a user