-
Notifications
You must be signed in to change notification settings - Fork 18
Creating patch guide
ZCube edited this page Jan 21, 2023
·
4 revisions
Basically, creating a compatible image is reverse engineering. It's not easy to find another guide. Components written in the same language are good references.
First of all, below is how I use it.
- First, find the list of components you need.
- Find a list of components that need to be worked on.
go run main.go list --app=matomo
* [ ] matomo:4.13.1
❌ matomo.4.13.1-1
You only need one matomo component.
- Identify the required language
- php ( from https://github.com/matomo-org/matomo )
- Check bitnami docker image.
docker run --rm -ti bitnami/matomo /bin/bash -c "ls -al /opt/bitnami"
docker run --rm -ti bitnami/matomo /bin/bash -c "find /opt/bitnami/matomo"
- Basically, you need to prepare all executable files in /opt/bitnami/{{component}/bin
- Other files in /opt/bitnami/{{component} also need to be prepared in some cases, refer to the component related guide.
- References other components that use the same language.
- wordpress
cat patches/wordpress/6/docker/Dockerfile.from
# Dockerfile.from = One stage in a multistage build of a Dockerfile.
FROM alpine:3.12.0 as wordpress
COPY --from=bitnami/wordpress:{{{VERSION}}} /opt/bitnami/wordpress/ /opt/bitnami/wordpress/
COPY --from=bitnami/wordpress:{{{VERSION}}} /opt/bitnami/wp-cli/ /opt/bitnami/wp-cli/
cat patches/wordpress/6/docker/Dockerfile.install
# Dockerfile.install = Dockerfile content to be embedded in main stage
COPY --from=wordpress /opt/bitnami/ /opt/bitnami/
- Create a component patch based on the patch found in step 4.
go run main.go makeDirs --app=matomo
# Dockerfile.from = One stage in a multistage build of a Dockerfile.
vi patches/matomo/4/docker/Dockerfile.from
... something
# Dockerfile.install = Dockerfile content to be embedded in main stage
vi patches/matomo/4/docker/Dockerfile.install
... something
- Testing. 6 on failure
go run main.go generate --app=matomo
go run main.go build --app=matomo
- Complete
I hope this guide is helpful.
- PHP ( Possibility to work by simply copying the component directory. )
- Java ( Possibility to work by simply copying the component directory. )
- Golang ( Build or copy from docker image)
- APT ( Basically refer to the Dockerfile of the official image )