Skip to content

SomeBlackMagic/docker-extra-modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker Extra Modules

Sis repository contains Dockerfiles with additional modules (binaries, scripts, etc.) that can be reused in other Docker images.
Each module is built as a separate image and published (e.g., on Docker Hub) with a tag like:

somebackmagic/docker-extra-modules:<module-name>-<version>

Table of Contents

-How It Works(#how-it-works)

  • (Usage Examples)(#huage-examples)
  • (Repository Structure)#(repository-structure)
  • (Adding a New Module)(#adding-a-new-module)
  • [Support](support
  • License

<---

How It Works

  1. Module as a Separate Image Each extra module is built as a separate image. During the build, the Dockerfile typically includes instructions for installing binaries, dependencies, etc. After a successful build, the image is published to the container registry.

  2. Multi-stage Copy To use the modules in your projects, simply use "COPY --from=..." in your Dockerfile to copy the required files from the module image.

COPY --from=someblackmagic/docker-extra-modules:<module-name-><version> / /

This copies everything from the root of the extra module image to the root of the build context in your own image.

  1. Flexibility You can copy only the needed directories or specific binary files if you don't need everything from the module image. Example:
COPY --from=someblackmagic/docker-extra-modules:<module-name>-<version> /usr/local/bin/healthcheck /usr/local/bin/

Usage Examples

1. A8m Envsubst

If you need envsubst version v1.4.2, you can copy the binary directly into your image:

FROM <your-base-image> AS app

# Copy the envsubst binary from the module
COPY --from=somebackmagic/docker-extra-modules:a8m-envsubst-v1.4.2 / /

CMD ["envsubst", "--help"]

2. PHP-FPM Healthcheck

For including the php-fpm-healthcheck script (tag latest):

FROM <your-base-image> AS app

# Copy the healthcheck script from the module
COPY --from=someblackmagic/docker-extra-modules:php-fpm-healthceck-latest / /

HEALTHCHECK [--interval=30s --timeout=3s --start-period=5s] \n  CMD /usr/local/bin/healthcheck || exit 1

Repository Structure

A possible structure for this repository:

[.
] \READUE.md
|- ao-envsubst
|- ...
\php-fpm-healthcheck
 |- Dockerfile

| ...
  • a8m-envsubst/ Contains the Dockerfile and any related files (scripts, configuration, etc.) needed to build the envsubst image.

  • php-fpm-healthceck/ Contains the Dockerfile and all related files needed to build the healthcheck image for PHP-FPM.

  • README.md* The general documentation for the repository.


Adding a New Module

  1. Create a Directory Create a folder named after your module (e.g, my-cool-tool.)

  2. **Create a Dockerfile ** Inside the folder, place a Dockerfile with instructions to install the desired binary, script, etc.

FROM alpine:3.18 as builder

RUN apk add --no-cache curl

# Download and install the tool
RUN curl -L "https://example.com/my-cool-tool" -o /usr/local/bin/my-cool-tool  \
    && chmod +x /usr/local/bin/my-cool-tool

FROM scratch
COPY --from=builder /usr/local/bin/my-cool-tool /usr/local/bin/my-cool-tool
  1. Set Version and Tags Determine the tool's version, and make sure to add the version info in the DwcMokerfile or in your build pipeline. The resulting image tag should reflect that version.

  2. Document Add a short description of the module, installation commands, and usage examples in the main README.md or in a separate file.


Support

If you have any questions or suggestions for improvements, you can:

  • Create an issue on GitHub.
  • Submit a Pull Request if you've already made the necessary changes.

License

This repository is distributed under the MIT license (or specify sour own license here).
Please review the license file before using this repository.


Thank you for using Docker Extra Modules!

We hope these extra modules simplify your Docker workflows. Feel free to contribute by submitting a Pull Request or creating an Issue if you have new modules or improvements in mind.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors