Oct 7, 2018

[HDGEM] How to build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

$ sudo docker ps

View all processes

$ sudo docker ps -a

Run an image in a new container daemonized

$ sudo docker run -d <image_name>

Run an image in interactive mode with the command /bin/bash

$ sudo docker run -it <image_name> /bin/bash
$ sudo docker run -it oraclelinux /bin/bash

Run an image in interactive mode with the command /bin/bash and link the ports.

$ sudo docker run -it --link <docker_container_name>:<docker_container_alias> <image_name> /bin/bash

Run an image with an ENTRYPOINT command in interactive mode with the command /bin/bash

$ sudo docker run --entrypoint /bin/bash -it <image_name>

Run an image in interactive mode with the command /bin/bash mounting the host director /var/app to the container directory /opt/src

$ sudo docker run -i -t -v /opt/app:/opt/src/ <image_name> /bin/bash

Run an image in interactive mode with the command /bin/bash setting the environments variables hdgem and goyun

$ sudo docker run -i -t -e hdgem=i88ca -e goyun=info <image_name> /bin/bash


--
Posted By Blogger to HDGEM at 4/17/2017 09:05:00 AM