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.

  • docker python: committed changes in a container but new image does not run
  • /sys on the host is becoming read-only once Docker is started
  • How to mount Hadoop HDFS
  • How could I run nginx-naxsi in baseimage?
  • Golang Microservices can't communicate using Docker for Mac
  • Connecting to RDS Mysql from docker container with WordPress
  • 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
    

  • Error while is docker pull image
  • Docker-compose check if mysql connection is ready
  • Error response from daemon: Cannot start container
  • Docker-compose with Storm 0.10.0 and Zookeeper (connection loss)
  • Docker Rails Production Logging
  • Docker OSX Unable to Access Container via IP Address
  • 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.