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

fix: capitalize 'as' to follow from-as-casing rule #687

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

kurokobo
Copy link
Contributor

Closes #686

This PR capitalizes as to follow the from-as-casing rule to supress warnings during build on Docker Engine 27+: https://docs.docker.com/reference/build-checks/from-as-casing/

Test:

# Install customized Ansible Builder
pip install .
# Ensure no warnings are displayed during build
$ ansible-builder build --tag registry.example.com/ansible/ee:2.17-minimal --container-runtime docker --verbosity 3
Ansible Builder is generating your execution environment build context.
...
Ansible Builder is building your execution environment image. Tags: registry.example.com/ansible/ee:2.17-minimal
Running command:
  docker build -f context/Dockerfile -t registry.example.com/ansible/ee:2.17-minimal context
#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.96kB done
#1 DONE 0.0s
...
#32 exporting to image
#32 exporting layers done
#32 writing image sha256:73227f703dbf35eb822caa325f0db8593fb10719bbb64d21615ea7ddd50df04e done
#32 naming to registry.example.com/ansible/ee:2.17-minimal done
#32 DONE 0.0s

Complete! The build context can be found at: /home/********/builder/context
# Ensure `AS` in the generated Dockerfile are capitalized
$ cat context/Dockerfile 
...
# Base build stage
FROM $EE_BASE_IMAGE AS base
...
# Galaxy build stage
FROM base AS galaxy
...
# Builder build stage
FROM base AS builder
...
# Final build stage
FROM base AS final
# Ensure `docker build --check .` passed
$ cd context/
$ docker build --check .
[+] Building 0.7s (3/3) FINISHED                                                                                                                                            docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                  0.0s
 => => transferring dockerfile: 2.96kB                                                                                                                                                0.0s
 => [internal] load metadata for quay.io/centos/centos:stream9-minimal                                                                                                                0.7s
 => [internal] load .dockerignore                                                                                                                                                     0.0s
 => => transferring context: 2B  

@kurokobo kurokobo requested a review from a team as a code owner June 23, 2024 15:20
@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Jun 23, 2024
@kurokobo
Copy link
Contributor Author

Oh, I missed that there are unit tests. Will update this PR to fix tests.

@kurokobo
Copy link
Contributor Author

Updated.

@Shrews
Copy link
Contributor

Shrews commented Jun 25, 2024

Assuming these pass tests, I'll be ok with this change. But I don't want to really begin chasing docker linting rules, at least not without some sort of testing in place within our CI to catch the warnings, and prevent accidental reverts.

@Shrews Shrews merged commit b1273ed into ansible:devel Jun 25, 2024
12 checks passed
@Shrews Shrews removed the needs_triage New item that needs to be triaged label Jun 25, 2024
Shrews pushed a commit to Shrews/ansible-builder that referenced this pull request Jun 25, 2024
* fix: capitalize 'as' to follow from-as-casing rule

(cherry picked from commit b1273ed)
Shrews added a commit that referenced this pull request Jun 25, 2024
* fix: capitalize 'as' to follow from-as-casing rule

(cherry picked from commit b1273ed)

Co-authored-by: kurokobo <kuro664@gmail.com>
@kurokobo kurokobo deleted the fromascasing branch June 25, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building the image with Docker Engine 27+ gives some warnings
2 participants