Jump to content

Docker Images


abarbarian

Recommended Posts

I have been keeping an eye on the Docker program for some while and whilst I have yet to give it a run I think it is one of the most exiting developments in the IT world. It seems to have some advantages over programs like VM or Virtual Box.

 

Not familiar with docker ! Well if you do not get up to speed then like the dinosaur you will become extinct.Here is a some information to stop that happening.

 

Solomon Hykes Explains Docker (2013)

 

 

 

What is Docker?

solomon2.jpg

Docker brings the power of Linux containers (LXC) and aufs (Another Union File System) to create a new level of packaging and process isolation that really is something you should sit up and take note of.

The first thing to mention about Docker is that it is a single executable daemon. That means it is easy to download and start running docker images on your Linux-based operating system. This docker daemon manages the docker processes, which run inside of LXC containers.

A docker process is an instance of a docker image, and a docker image has one primary process that will run when you instantiate it.

Have a spare 100 milliseconds and you want to run CouchDB? "docker run couchdb". A second later CouchDB will be running in an isolated container. It will be unaware that it is running inside of Docker.

Want to run a headless Firefox with a VNC interface under Suse Linux? Just run the docker image for that. Want to run 20 instances of that docker image on the same machine? Just run "docker run" 20 times. Each process thinks it is binding to the same port. Suddenly you are testing a Cassandra or Hadoop cluster on one machine.

 

 

I know I am a couple of years late in posting this but as they say better late than never.

 

So this thread is dedicated to Docker images that are becoming available.

 

Docker images of Kali Linux 2.0 (2015)

 

 

About a week ago the Kali Linux (live) distribution version 2.0 was released, now Offensive Security – the company behind Kali Linux – has published so-called Docker images of Kali Linux 2.0, which lets you run it on any platform.

 

:breakfast:

 

Has anyone used Docker ? If so please do post your experiences.

Edited by abarbarian
Link to comment
Share on other sites

securitybreach

Wow that was simple.. I just followed the installation, setup user from here: https://wiki.archlin...ndex.php/Docker

 

Then as root, I ran this to fetch the kali docker:

 root@Cerberus Dockers #docker pull kalilinux/kali-linux-docker
Using default tag: latest
latest: Pulling from kalilinux/kali-linux-docker
e1bfb89993bf: Pull complete
b4be4f2256bf: Pull complete
93d580d5b6d4: Pull complete
7267bc58e014: Pull complete
2c00b1e4f611: Pull complete
a5acfcddcae4: Pull complete
e3177c843499: Pull complete
198c6df71ab3: Already exists
Digest: sha256:fcc3e894b9d03b20e37f3e4748dbca798a8e1a50ec7b9ddfa1e9dbd1b208efa1
Status: Downloaded newer image for kalilinux/kali-linux-docker:latest

 

Then I started it with this:

root@Cerberus Dockers # docker run -t -i kalilinux/kali-linux-docker /bin/bash

root@697ac8535c64:/# cat /etc/issue
Kali GNU/Linux 2.0 \n \l

root@697ac8535c64:/# 

 

If you notice above when I run the command, it puts me in kali (notice the output of cat /etc/issue)

Link to comment
Share on other sites

securitybreach

Super neat job. Does Kali tun as smooth as it would on a full install ? B)

 

I just knew you would have a go if I dangled some bait :fishing:

 

I never went through and installed X, etc. It just gives you terminal access.

Link to comment
Share on other sites

Now I just need to find out where it holds the actual containers.

 

<path> is your docker home. The path defaults to /var/lib/docker.

 

Could this be where. :fish:

Link to comment
Share on other sites

securitybreach

Now I just need to find out where it holds the actual containers.

 

is your docker home. The path defaults to /var/lib/docker.

 

Could this be where. :fish:

 

Yeah but I need to move that to another harddrive.

Link to comment
Share on other sites

securitybreach

Oh I know how to fix it.

 

cp -rvf /var/lib/docker /home/comhack/Miscellaneous/

 

Then edit /etc/docker and add:

 

DOCKER_OPTS="-g /home/comhack/Miscellaneous/docker/"
Link to comment
Share on other sites

So you have /home on one drive and , / , on another ?

 

I get the code for cp, but what is the " -g " for in "-g /home/comhack/Miscellaneous/docker/" ?

 

:'(

 

Wait, you need to stop docker.service first

 

systemctl stop docker.service

 

Makes sense. :whistling:

Link to comment
Share on other sites

Does this help ?

 

 

 

 

To save image to any file path or shared nfs see following example.

Get image id by doing:

sudo docker image

 

Say you have image with id "matrix-data"

Save image with id:

sudo docker save -o /home/matrix/matrix-data.tar matrix-data

 

Copy image from path to any host Now import to your local docker using :

sudo docker load -i <path to copied image file>

 

Hope this make make more clear.

Thanks

 

 

 

http://stackoverflow.com/questions/23935141/how-to-copy-docker-images-from-one-host-to-another-without-via-repository

 

:whistling:

Link to comment
Share on other sites

securitybreach

I'm still working on it but I wish I could simply have everything point to a different directory, not just the containers and volumes.

 

I figured out a couple of things though:

 

For instance, to get the list of containers, run this:

docker ps -a

 

And the output looks like this:

lGZhQ82.png

 

I figured out you can save the Container by using:

docker save fd72eaa75035 > ~/Miscellaneous/docker/fd72eaa75035.tar

 

But I am having issues loading the container afterwards:

root@Cerberus docker #docker load -i -t fd72eaa75035.tar /bin/bash
docker: "load" requires 0 arguments
See 'docker load --help'.

Usage: docker load [OPTIONS]

Load an image from a tar archive or STDIN
root@Cerberus docker # 

 

Most of this I figured out from the zsh switch tab completion and these links:

https://docs.docker.com/userguide/usingdocker/

https://groups.google.com/forum/#!topic/docker-user/AKqf_qIhFL4

Link to comment
Share on other sites

Well in my example they do things from the os terminal as in

" sudo docker save -o"

which is

" root@homepc# docker save -o"

wheras you are doing

" root@Cerberus docker #docker -o "

so you are trying to do things from within docker. I think that may be the problem.

 

:shifty:

 

Also in my example there is only an " -i " option wheras you gave a " -i -t " which may make a difference.

 

Also you are trying to load an image by id wheras you may need to do " <path to copied image file> " instead.

 

I could be wrong. It will have to happen someday :breakfast: :Laughing:

Edited by abarbarian
Link to comment
Share on other sites

securitybreach

Well in my example they do things from the os terminal as in

" sudo docker save -o"

which is

" root@homepc# docker save -o"

wheras you are doing

" root@Cerberus docker #docker -o "

so you are trying to do things from within docker. I think that may be the problem.

 

:shifty:

 

Yeah, I realized that by this command on the last comment:

docker save fd72eaa75035 > ~/Miscellaneous/docker/ fd72eaa75035.tar

Link to comment
Share on other sites

New day new cock ups :yes: at least we are learning how to bug chase :clap2:

 

I found this

 

https://docs.docker.com/installation/archlinux/

 

 

Custom daemon options

 

If you need to add an HTTP Proxy, set a different directory or partition for the Docker runtime files, or make other customizations, read our systemd article to learn how to customize your systemd Docker daemon options.

 

Which takes us here

 

https://docs.docker.com/articles/systemd/

 

 

Runtime directory and storage driver

 

You may want to control the disk space used for Docker images, containers and volumes by moving it to a separate partition.

 

In this example, we’ll assume that your docker.service file looks something like:

[unit]

Description=Docker Application Container Engine

Documentation=https://docs.docker.com

After=network.target docker.socket

Requires=docker.socket

 

[service]

Type=notify

ExecStart=/usr/bin/docker daemon -H fd://

LimitNOFILE=1048576

LimitNPROC=1048576

 

[install]

Also=docker.socket

 

This will allow us to add extra flags via a drop-in file (mentioned above) by placing a file containing the following in the /etc/systemd/system/docker.service.d directory:

[service]

ExecStart=

ExecStart=/usr/bin/docker daemon -H fd:// --graph /mnt/docker-data --storage-driver btrfs

 

You can also set other environment variables in this file, for example, the HTTP_PROXY environment variables described below.

 

What stumps me is what to call the file :>

Link to comment
Share on other sites

So how are things down on the waterfront. :fish:

 

Haven't played as I have been too busy trying to get a freaking job

 

Best of luck with the hunt. :breakfast:

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...