Skip to content

Commit

Permalink
new post: docker build without cache
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagowfx committed Dec 10, 2024
1 parent 8da4901 commit eb95b8a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions content/posts/2024-12-10-docker-build-ignore-cache.md
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.

0 comments on commit eb95b8a

Please sign in to comment.