Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/daggerok/docker-maven-plugin-example

Manage Docker daemon with Maven
https://github.com/daggerok/docker-maven-plugin-example

docker docker-maven-plugin fabric8 fabric8-maven-plugin maven maven-plugin

Last synced: 6 days ago
JSON representation

Manage Docker daemon with Maven

Awesome Lists containing this project

README

        

# manage docker with maven
In this example I'm going to demonstrate how easily amd quick postgres database can be started in docker by using
fabric8 `docker-maven-plugin`

Table of Content

- [Install](#install)
- [`docker run -d` with `mvn docker:start`](#start)
- [`docker rm -f -v` with `mvn docker:stop`](#stop)
- [Help with `mvn docker:help`](#help)
- [Reference for reading](#read-more)

## install

assuming you have in your `pom.xml` file:

```xml

healthcheck/postgres:alpine
postgres
5432:5432

postgres
postgres
postgres
10000
PostgreSQL init process complete




io.fabric8
docker-maven-plugin
0.28.0

true
true
500
default
true
always



properties
postgres.docker







```

## start

_start postgres container with `docker run -d -p 5432:5432 ... healthcheck/postgres:apline` command_

```bash
mvn docker:start
```

## stop

_stop and remove container, like with `docker rm -f -v postgres-1` command_

```bash
mvn docker:start
```

## help
```bash
mvn docker:help
```

## cleanup if you missed to remove your other images

```bash
for i in $(docker images -q -f dangling=true); do docker rmi -f $i ; done
```

## read more

- [External Configuration](https://dmp.fabric8.io/#external-configuration)
- [docker:stop reference](https://dmp.fabric8.io/#docker:stop)