docker no cache code example

Example 1: docker clear cache

# Rebuild the image
docker build --no-cache

# Pull the base images again and rebuild
docker build --no-cache --pull

# Also works with docker-compose
docker-compose build --no-cache

# If nothing of the above works for you, you could also prune everything
docker system to prune

Example 2: docker clear cache

docker volume prune

Example 3: docker build don't use cache

docker build --no-cache

Example 4: how to create docker image from custom filename

cat DockerFile.debian.foo | docker build -t debian.foo -

Example 5: create dockerfile

FROM ubuntu:18.04
COPY . /app
RUN make /app
CMD python /app/app.py