Tags

docker build -t {IMAGENAME} .

$ docker build -t skillsoftror_mysql . 

docker run –name {CUSTOMNAME} -p 3000:3000 –link {CONTAINER}:{IMAGE} {IMAGE} rails server –port 3000 –binding 0.0.0.0

$ docker run \
       --name railsapp \
       -p 3001:3001 \
       --link mysql57:mysql \
       skillsoftror_mysql \
       rails server --port 3001 --binding 0.0.0.0 

$ docker stop railsapp3310 && docker rm -f railsapp

Running like these is wrong!!
$ docker run \
–name mysql55_2 \
–net=host \
-p 3310:3310 \
-e MYSQL_ROOT_PASSWORD=webdevel \
-d mysql:5.5


How to run mysql (version 5.5/5.7) container

$ docker run \
       --name mysql57 \
       -p 3310:3306 \
       -e MYSQL_ROOT_PASSWORD=webdevel \
       -d mysql:5.7

$ docker run \
       --name mysql55 \
       -p 3310:3306 \
       -e MYSQL_ROOT_PASSWORD=webdevel \
       -d mysql:5.5

$ docker exec -it mysql55 bash

How to run phpmyadmin in Docker
First, we need to run the mysql container like this:

$ docker run \
         --name mysql57 \
         -p 3310:3306 \
         -e MYSQL_ROOT_PASSWORD=webdevel \
         -d mysql:5.7

Once the mysql container is started, we’re going to install the phpmyadmin and link it to him.

$ docker run \
         --name phpmyadmin57 \
         -d \
         --link mysql57:db \
         -p 8080:80 \
         phpmyadmin/phpmyadmin

Open the phpmyadmin in your browser enter your DOCKER MACHINE IP + MYSQL_PORT e.g, http://192.168.59.103:8080. Tadangg! it works!


How to run cloudant-developer

STEP1
$ docker run \
       --privileged \
       --detach \
       --volume cloudant:/srv \
       --name cloudant-developer \
       --publish 8000:80 \
       --hostname cloudant.dev \
       ibmcom/cloudant-developer
STEP2
$ docker start cloudant-developer

Open the cloudant dashboard in your browser enter your DOCKER MACHINE IP + CLOUDANT_PORT e.g, http://192.168.59.103:8000. Tadangg! it works!


How to run mongodb container

$ docker run -d --name mongo -p 27017:27017 mongo:3.2.8

How to run redis container

$ docker run -d --name redis -p 6379:6379 redis

How to run postgres container using bitnami

$ docker run \
         --name pgrorblogv1 \
         -v /c/postgresql:/bitnami \
         bitnami/postgresql:latest

How to run postgres container using official postgre

# Using official postgres
$ docker run \
         --name postgresdb \
         -e POSTGRES_PASSWORD=webdevel \
         -p 5432:5432 \
         -d postgres:latest
# Once the postgres is running, lets try it.
$ docker exec -it postgresdb bash
# default user is postgres instead of root. For more info: psql --help
$ psql -U postgres 
# Try to execute postgres command
postgres=# SELECT version();
 PostgreSQL 9.6.3 on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit
(1 row)
postgres=# /q   (to exit from cli or press CTRL+d)
<hr>
<strong>Postgres with persistent data</strong>
$ docker run \
         --name postgresdb \
         -d \
         -p 8432:5432 \
         -e POSTGRES_PASSWORD=webdevel  \
         -v /c/postgresdata:/var/lib/postgresql/data postgres:latest \
         

How to run the pgAdmin
First, install the postgres server if it doesn’t exist yet.

$ docker run \
         --name pg9 \
         -e POSTGRES_USER=bob \
         -e POSTGRES_PASSWORD=webdevel \
         -p 5432:5432 \
         -d postgres:9

Once the postgres is install successfully then lets install the pgAdmin.

Note: This image won’t work 😦

$ docker run \
         --name pgadmin4 \
         --link pg9:postgres \
         -p 5050:5050 \
         -d chorss/docker-pgadmin4

Instead use this image and it works!

$ docker run \
         --name pgadmin4 \
         --link pg9:postgres \
         -p 5050:5050 \
         -d fenglc/pgadmin4

As we can see, we’re going to link our created postgres container(pg9) to the pgAdmin container(pgadmin4).
Use the default administrator account to log in:
user: pgadmin4@pgadmin.org
password: admin
Access the website at http://localhost:5050 or http://docker-host-ip:5050 in your browser.
Next, create new SERVER. Input the following details:
Host: {docker-host-ip}
Username: bob
Password: webdevel
Port: 5432
And then saved. Tadangg! It should works!

Sources:
https://hub.docker.com/r/fenglc/pgadmin4/
https://hub.docker.com/r/chorss/docker-pgadmin4/


How to run Debian container

$ docker run --name debianjessie -it debian:jessie bash
Advertisements