I want to create a Docker image which contains Java and PostgreSQL. I just want to create an Image to reuse it from anywhere

I want to create a Docker image which contains Java and PostgreSQL. I just want to create an Image to reuse it from anywhere.

From reading the documentation I don’t understand how I can do that.

  • Jersey Grizzly HTTP Server shutdown inside container docker
  • How to map hyperledger fabric peers (2nd, 3rd , 4th) with ports for REST communication
  • Intranet name resolution in docker container
  • Dockerizing a maven app that uses oracle-ojdbc: How do you get the driver in there?
  • How to create a virtual cluster using docker on a single node?
  • automation script for postgresql
  • This is what I tried:

    user@host:/$ docker run -i -t debian /bin/bash 
    root@container:/$ apt-get install postgresql-9.3
    user@host:/$ docker ps 
    user@host:/$ docker commit <CID> username/postgresql
    

  • why failed to forward public ip to docker NAT ip
  • mongoDB multiple instances or multiple databases
  • Accessing the same mongoDB instance from multiple Docker containers
  • Install docker-volume-netshare on Linux AMI
  • Is there an Official Android development environment image on Docker?
  • How to list container image versions in the Google private Container Registry
  • One Solution collect form web for “I want to create a Docker image which contains Java and PostgreSQL. I just want to create an Image to reuse it from anywhere”

    Why reinvent the wheel ? If you look at the registry, it already exists, see
    https://registry.hub.docker.com/u/alinous/docker-java-postgresql/
    Another way, you can also add PostgreSQL to a Java container, like this one
    https://registry.hub.docker.com/u/dockerfile/java/ or add Java to a PostgreSQL container…

    so start your Dockerfile with from dockerfile/java

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.