matteodri / owl-energy-monitor

Java application to expose Owl Intuition data through Prometheus and Grafana
MIT License
2 stars 0 forks source link

Integrate with Docker hub #2

Open matteodri opened 4 years ago

matteodri commented 4 years ago

https://docs.docker.com/docker-hub/

To have the images automatically pushed to a public space. Not sure how important this is. If using docker-compose is enough then that's fine.

Once images are on docker hub we could also have docker run commands for the single services like for prometheus:

docker container run --name=prometheus \
        --hostname=prometheus \
        --user=root \
        --memory=512m \
        --memory-swap=512m \
        --network=local \
        -v /data/owl-energy-monitor/prometheus/:/prometheus \
        -p 9090:9090 \
        matteodri/prometheus:v0.1.0 --config.file=/etc/prometheus/config/prometheus.yml --storage.tsdb.retention.time=168h

or

docker container run --name=owl-energy-monitor \
         --network=local \
         -e EXTRA_JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:9005" \
         -p 9001:9001 \
         -p 9005:9005 \
         matteodri/owl-energy-monitor:${version}
matteodri commented 4 years ago

How to integrate with docker hub using fabric8 plugin (hope it's similar to spotify one) http://www.littlebigextra.com/push-docker-images-docker-hub-using-maven/

or https://github.com/spotify/dockerfile-maven/issues/51

matteodri commented 4 years ago

Or to push directly from CircleCI: https://circleci.com/blog/build-a-ci-powered-restful-api-with-laravel/

matteodri commented 4 years ago

Registry could be added to the pom and image pushed with the deploy target Now this is returned on "mvn deploy" [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project owl-energy-monitor: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]

matteodri commented 3 years ago

Another option is to do it with a Github action: https://github.com/marketplace/actions/build-and-push-docker-images

It supports also multiplatform builds, so it could create and push the raspberry image

SAME THING WITH CIRCLECI: https://www.docker.com/blog/multi-arch-build-what-about-circleci/

matteodri commented 3 years ago

https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/