stefanneuhaus / dependencycheck-central-mysql-docker

Self-updating OWASP DependencyCheck Database Server :book:
https://hub.docker.com/r/stefanneuhaus/dependencycheck-central-mysql/
Apache License 2.0
15 stars 9 forks source link

add multi arch build for amd64 and arm64 #21

Closed nauni77 closed 3 months ago

nauni77 commented 8 months ago

First of all I want to say thanks for your image and the sources.

I had always issues to run your image on mac OSX. After a sleep the container of your image was often not working anymore. Because of this I added the possibility to build the container for linux/arm64 and linux/amd64.

If you want to build the container for both architectures and push both architectures to dockerhub you can do:

$ docker buildx create --use
$ docker buildx build --platform linux/arm64,linux/amd64 --push --tag ${IMAGE_NAME}:latest --tag ${IMAGE_NAME}:${VERSION} .

Of cause - replace {IMAGE_NAME} and ${VERSION} with valid values.

Even the regular build with docker build -t stefanneuhaus/dependencycheck-central-mysql:latest . is still working with this change. But at Mac OSX it will build a arm64 image and with INTEL it will create a amd64 image.

If you have questions and comments please write a message.

Thanks and regards, Oli

P.S.: You don't need to take the Makefile - it's just the way I devolop and avoid writing to long commands or take care for build steps during development.

nauni77 commented 8 months ago

I added more changes. Now you can reuse the data of your OWASP db while restarting the container. At a cluster (as we use it) just two PVCs are needed. As defined at Dockerfile.

To download the OWASP DB takes very long and the builds had wrong results during update. Because of this I added this feature to reuse the DB. If a SQL-update-script is changed the database is deleted before starting and the OWASP-DB is completely downloaded again.

I hope this helps even other people using the owasp-db.