Anonymous
×
Create a new article
Write your page title here:
We currently have 27 articles on PhenixOps. Type your article name above or click on one of the titles below and start writing!



PhenixOps
27Articles

Other: Difference between revisions

Line 5: Line 5:
<code>
<code>
apt-get install -y apt-transport-https ca-certificates surl software-properties-commn
apt-get install -y apt-transport-https ca-certificates surl software-properties-commn
</code>
</code> <br>


If needed import the docker repo
If needed import the docker repo
<code>
<code>
apt-get update
apt-get update
</code>
</code> <br>


Install Docker
Install Docker
<code>
<code>
apt-get install docker-ce
apt-get install docker-ce
</code>
</code> <br>


=== Useful commands ===
=== Useful commands ===
Line 22: Line 22:
<code>
<code>
docket info
docket info
</code>
</code> <br>


Check Version of client and server
Check Version of client and server
<code>
<code>
docker version
docker version
</code>
</code> <br>




Line 33: Line 33:
<code>
<code>
docker search ''image''
docker search ''image''
</code
</code> <br>


Get images you want to run  
Get images you want to run  
<code>
<code>
docker pull ''image''
docker pull ''image''
</code>
</code> <br>


Show the images  
Show the images  
<code>
<code>
docker image
docker image
</code>
</code> <br>


Run an image
Run an image
<code>
<code>
docke run ''image''
docke run ''image''
</code>
</code> <br>


Search images  
Search images  
<code>
<code>
docker search ''image''
docker search ''image''
</code>
</code> <br>


Run Hello World (Shows a Hello World message on the commandline)
Run Hello World (Shows a Hello World message on the commandline)
Line 59: Line 59:
docker pull hello-world
docker pull hello-world
docker run hello-world
docker run hello-world
</code>
</code> <br>
Shows a Hello World and message on the commandline
Shows a Hello World and message on the commandline <br>


Run httpd webserver
Run httpd webserver
Line 66: Line 66:
docker pull httpd
docker pull httpd
docker run httpd
docker run httpd
</code>
</code> <br>


Run http and expose it to the outside world (''-p container:host'')
Run http and expose it to the outside world (''-p container:host'')
<code>
<code>
docker run -p 80:80 --name web01 -d httpd
docker run -p 80:80 --name web01 -d httpd
</code>
</code> <br>


Show running containers
Show running containers
<code>  
<code>  
docker ps
docker ps
</code>
</code> <br>


Get stuff from the webserver
Get stuff from the webserver
<code>
<code>
curl localhost
curl localhost
</code>
</code> <br>


Stop the container
Stop the container
<code>
<code>
docker stop web01
docker stop web01
</code>
</code> <br>


Remove the container
Remove the container
<code>
<code>
docker rm web01
docker rm web01
</code>
</code> <br>


=== Comments ===
=== Comments ===

Revision as of 20:31, 24 April 2020

Other stuff and work in progress that does not have it's own section yet

Docker


Installation

apt-get install -y apt-transport-https ca-certificates surl software-properties-commn

If needed import the docker repo apt-get update

Install Docker apt-get install docker-ce

Useful commands

Information docket info

Check Version of client and server docker version


Search images (usually from hub.docker.com) docker search image

Get images you want to run docker pull image

Show the images docker image

Run an image docke run image

Search images docker search image

Run Hello World (Shows a Hello World message on the commandline) docker pull hello-world docker run hello-world
Shows a Hello World and message on the commandline

Run httpd webserver docker pull httpd docker run httpd

Run http and expose it to the outside world (-p container:host) docker run -p 80:80 --name web01 -d httpd

Show running containers docker ps

Get stuff from the webserver curl localhost

Stop the container docker stop web01

Remove the container docker rm web01

Comments