qswinson opened a new pull request, #594:
URL: https://github.com/apache/apisix-docker/pull/594

   [This 
commit](https://github.com/apache/apisix-docker/commit/3ec55476d853c27c8aed4b7766690f55019f65db)
 added a step to the build process to copy the 
`utils/check_standalone_config.sh` file into the targeted Docker project before 
being able to build the image. This is a well-meaning approach to reduce code 
duplication and ease maintenance. However, the problem with this approach is 
that it breaks the ability to use this repo as a remote Docker context as the 
Dockerfiles now include a `COPY` command for a file that does not exist in 
GitHub.
   The better way to handle this is to use named context to source the file 
from `./utils`. This PR updates the Dockerfile definitions and the Makefile 
build steps.
   With this change, anyone can now build images from my branch like this:
   ```
   docker build -t apisix --build-context 
utils=https://github.com/qswinson/apisix-docker.git#docker-named-context:utils 
https://github.com/qswinson/apisix-docker.git#docker-named-context:debian
   ```
   
   You can also define a [Docker Bake](https://docs.docker.com/build/bake/) 
file in your own repo to customize the final APISIX image. Name the file with 
the contents below`docker-bake.hcl` and build it with this command: `docker 
buildx bake apisix`.
   ```
   target base {
     context = 
"https://github.com/qswinson/apisix-docker.git#docker-named-context:debian";
     contexts = {
       "utils" = 
"https://github.com/qswinson/apisix-docker.git#docker-named-context:utils";
     }
   }
   
   target apisix {
     contexts = {
       baseapisix = "target:base"
     }
     dockerfile = "Dockerfile"
     tags = ["apisix:latest"]
     platforms = [
       "linux/x86_64"
     ]
   }
   ```
   
   Being able to build images on demand is very important for addressing 
security vulnerabilities that are resolved in the base debian/redhat image.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to