Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Remove use of --squash flag and switch to buildx #743

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

tgxworld
Copy link
Contributor

@tgxworld tgxworld commented Oct 13, 2023

Why this change?

In CI, we are seeing the following warning message:

WARNING: experimental flag squash is removed with BuildKit. You should squash inside build using a multi-stage Dockerfile for efficiency.

Basically, the --squash flag has not been working for quite some time and is redundant.

What does this change do?

  • This change removes the use of the --squash flag.

  • This change uses the buildx tool in auto_build.rb as we prepare to build images for multiple platforms.

raise "Error building the image for #{image[:name]}: #{lines[-1]}" if lines[-1] =~ /successfully built/
lines =
run(
"cd #{image[:name]} && docker buildx build . --no-cache --tag #{image[:tag]} #{image[:extra_args] ? image[:extra_args] : ""}",
Copy link
Contributor Author

@tgxworld tgxworld Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual change is here. The rest of the changes in this file is just linting due to syntax_tree.

Comment on lines +12 to +16
base_slim_arm64: {
name: "base",
tag: "discourse/base:build_slim_arm64",
extra_args: "-f slim.Dockerfile --platform linux/arm64",
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New image added here.

@tgxworld
Copy link
Contributor Author

@davidtaylorhq @xfalcox Can I trouble you guys for a review here? Thank you! 🙇

@davidtaylorhq
Copy link
Member

I think we could also remove:

- name: enable experimental docker features
run: |
sudo bash -c 'echo "{ \"cgroup-parent\": \"/actions_job\",\"experimental\":true}" > /etc/docker/daemon.json'
sudo service docker restart
docker version -f '{{.Server.Experimental}}'

@tgxworld tgxworld force-pushed the remove_use_of_docker_squash branch from 5d0766f to 7d60658 Compare October 15, 2023 23:53
Why this change?

In CI, we are seeing the following warning message:

```
WARNING: experimental flag squash is removed with BuildKit. You should squash inside build using a multi-stage Dockerfile for efficiency.
```

Basically, the `--squash` flag has not been working for quite some time
and is redundant.

What does this change do?

* This change removes the use of the `--squash` flag.

* This change uses the `buildx` tool in `auto_build.rb` as we prepare to
  build images for multiple platforms.
@tgxworld tgxworld force-pushed the remove_use_of_docker_squash branch from 7d60658 to 9a6ec1b Compare October 15, 2023 23:53
@tgxworld
Copy link
Contributor Author

Thank you for reviewing @davidtaylorhq 👍

@tgxworld tgxworld merged commit 0c93b22 into main Oct 16, 2023
3 of 4 checks passed
@tgxworld tgxworld deleted the remove_use_of_docker_squash branch October 16, 2023 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants