-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new post: docker build without cache
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: "Docker build: ignore cache" | ||
date: 2024-12-10T19:45:42-03:00 | ||
tags: | ||
- dev | ||
- devops | ||
--- | ||
|
||
To build a docker image completely from scratch, without reusing cache layers on | ||
your system: | ||
|
||
```shell | ||
docker build --no-cache -f Dockerfile . -t {image name}:{image tag} --platform | ||
linux/amd64 | ||
``` | ||
|
||
<!--more--> | ||
|
||
- Pass an explicit platform in case e.g. you're building on a Mac M1 (arm64) | ||
with the intent of running it on Linux in the cloud (amd64 typically). | ||
- The docker image full specification is: image = | ||
`{registry}/{repository}:{tag}`. For example, the registry could be an AWS ECR | ||
URL, whereas the repository is something like "bitnami/sealed-secrets", and | ||
the tag typically follows semantic versioning. |