GoogleCloudPlatform / GoogleCloudPlatform/cloud-builders

Docker build squash

Open
#897 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.5k
Forks
616
PR merge metrics
No merged PRs in 30d

Description

I would like to enable squash during build, but none of the workarounds available seem to do the trick, below is the current build and dockerfile, with following error

> "Step #1 - "build": "--squash" is only supported on a Docker daemon with experimental features enabled"

```
#syntax=docker/dockerfile:1.5.2
FROM jupyter/r-notebook:ubuntu-20.04
```

```
steps:
- id: 'pull-experimental'
name: 'gcr.io/cloud-builders/docker'
args: [ 'pull', 'docker/dockerfile:1.5.2' ]
env:
- DOCKER_BUILDKIT=1
# build the container image
- id: 'build'
waitFor: ['pull-experimental']
name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
['-c', 'docker build --squash --memory-swap=-1 -t eu.gcr.io/$PROJECT_ID/${_IMAGE_TAG} -f ${_IMAGE_NAME}/Dockerfile .']
env:
- DOCKER_BUILDKIT=1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.