On a centos7
# The service file for docker.service, on a centos7
service_file=/lib/systemd/system/docker.service
# Parameters we want to add
TO_ADD=$(cat <<'EOF'
Environment="BUILDKIT_STEP_LOG_MAX_SIZE=1073741824"
Environment="BUILDKIT_STEP_LOG_MAX_SPEED=10240000"
EOF
)
# add these parameters after the "Restart=..." line of the file
awk -v to_add="$TO_ADD" '{ if(/Restart=/) {print; print to_add} else {print} }' $service_file \
> /tmp/$(basename $service_file)
# overwrite the docker.service file with the new one
cat /tmp/$(basename $service_file) | sudo tee $service_file
# Reload, restart
sudo systemctl daemon-reload
sudo systemctl restart $(basename $service_file)
export BUILDKIT_PROGRESS=plain
or use the --progress=plain
option for docker build
(default value: auto
)