Use boot2docker or native docker install? - docker

I would like to use docker on a Linux environnent so I have 2 options :
Native install of docker on my linux mint
Use docker via a VM with boot2docker (or Vagrant/puppet)
I think that the VM way is more easy to install but you may have some difficulties to share data between your laptop and docker container (you have to install guest addition in virualbox for example ...)
On the other hand, the native install seems less easy but I think you gain some performance and sharing data more easily ...
So I would like to know, for you what are the advantages/inconvenients of the 2 methods ?
What was your choice and why ?
Thanks :)

Native installation of Docker
If you are already on Linux, there is simply no need for another tool and layer like a VM
Better performance (since you are not in a VM, but on your machine directly)
It is pretty easy, e.g. to install Docker on Ubuntu 14 just run curl -sSL https://get.docker.io/ubuntu/ | sudo sh
VM/Boot2Docker
Docker will not "pollute" your system - if you don't want to use Docker anymore, just throw away your VM, nothing will be left on your system
If you are on Linux already, I would just install Docker and you are done.

Related

Docker - the minconda image install on an operating system essential?

I am trying to create a docker file to use Miniconda and this container would be used to docker-compose to use with PostgreSQL.
I do not have much experience with docker, but I have a question.
Miniconda image can run itself such as installing libraries for using python.
But I saw people using the miniconda on an operating system like Ubuntu or Centos. So If I want to use docker-compose to use multiple containers should I have Miniconda on an OS?
thank you

Using Docker and Cypress in Same Docker Image

Fair warning: I'm new to all of this, so there there might be some mistakes in my thinking process.
I want to system test an application we are developing, and we ship this application via Docker, so that's what I want to test.
For GitLab CI, this means creating a Docker image which has Docker in Docker and Cypress, since that is what I'd like to use.
So just from checking the Docker docs I can see that Docker can be installed on a multitude of Linux distros, but not on Alpine. The official image however is Alpine.
The Cypress docs however show that Cypress can not be installed to Alpine. Only the package managers "apt-get" and "yum" are supported, which is Ubuntu and Fedora, respectively.
So as far as I can tell, it's not possible to have both of these at once? Which would be absolutely baffling (but so is the package manager chaos I just learned about).
What I tried:
used the Docker image as a base and tried to install Cypress (does not work because there is no installation manual and the packages you need to install via apt-get don't exist for apk)
used the Cypress image as a base and tried to install Docker (does not work because the Cypress images don't work)
used another image and tried to install both (does not work because installing Docker inside the Docker container does not work, that's why they have the image provided)
used DinD with another distro (cruizba/ubuntu-dind, fails with " dockerd is not running after max time")
So... what am I missing? Is there any way to get to the point where I can use both Cypress and DinD in the same image?
There is an image named blackholegalaxy/cypress-dind which combines DinD and Cypress.
Sadly it's really old and there is no way to update Docker to the newest version easily.

Enable gpu support by default on docker containers

I'm using a platform (Cytomine) on Ubuntu 18.04 to run some deep learning containerized applications (this platform handles the Docker images and containers automatically, so I only need to create the image and provide its download URL to the platform). So far it's working good but now I need to enable GPU support to run the model efficiently. Thus, I did some local tests with nvidia-docker to manually run the model container with GPU support, it was really easy to have it working because I just had to add one option to the run command:
docker run --gpus all
However, because I cannot add this option to the code on the Cytomine platform I need to find a way of adding/enabling that option by default to all the containers run by docker.
I tried adding this option to the files /etc/docker/daemon.json and /etc/docker/key.json and then restarted docker sudo systemctl restart docker. However, it didn't work.
Also, I found how to create docker config files (docker config); however, this seems to work only with Docker Swarm and I'm not going to use a Swarm for this project.
Thus, I'm looking for a straightforward solution that can be deployed properly. Is there any way to enable this option (--gpus all) by default when running any Docker container? (like somehow including it on the Dockerfile?)
Thanks!

Does kubernetes come with docker by default

According to this link docker is supporting kubernetes on linux, mac and windows. I can't make out whether or not kubernetes is installed within docker like swarm is. So is it true that with a normal install of docker it will also install kubernetes?
I would not say it'll be installed but you'll get the chance to do it if you want to.
Here's the about page:
Version 18.05.0-ce-win67 (18263)
Channel: edge
0c7f1aa
If you navigate to the Settings page (Docker CE for windows in my case), and select to enable Kubernetes, this is what you get:
If you choose to install it...
Wait a little...
After completion you can use your kubernetes - through regular docker stack * commands - to run a single-node cluster locally while developing. Which is really nice!
You can use the kubectl CLI directly also. It should be already in your PATH. The CLI is located at C:\Program Files\Docker\Docker\resources\bin.
Hope this helps!

How to convert VM image to dockerfile?

For work purpose, I have an ova file which I need to convert it to DockerFile.
Does someone know how to do it?
Thanks in advance
There are a few different ways to do this. They all involve getting at the disk image of the VM. One is to mount the VDI, then create Docker image from that (see other Stackoverflow answers). Another is to boot the VM and copy the complete disk contents, starting at root, to a shared folder. And so on. We have succeeded with multiple approaches. As long as the disk in the VM is compatible with the kernel underlying the running container, creating Docker image that has the complete VM disk has worked.
Yes it is possible to use a VM image and run it in a container. Many our customers have been using this project successfully: https://github.com/rancher/vm.git.
RancherVM allows you to create VMs that run inside of Kubernetes pods,
called VM Pods. A VM pod looks and feels like a regular pod. Inside of
each VM pod, however, is a container running a virtual machine
instance. You can package any QEMU/KVM image as a Docker image,
distribute it using any Docker registry such as DockerHub, and run it
on RancherVM.
Recently this project has been made compatible for kubernetes as well. For more information: https://rancher.com/blog/2018/2018-04-27-ranchervm-now-available-on-kubernetes
Step 1
Install ShutIt as root:
sudo su -
(apt-get update && apt-get install -y python-pip git docker) || (yum update && yum install -y python-pip git docker which)
pip install shutit
The pre-requisites are python-pip, git and docker. The exact names of these in your package manager may vary slightly (eg docker-io or docker.io) depending on your distro.
You may need to make sure the docker server is running too, eg with ‘systemctl start docker’ or ‘service docker start’.
Step 2
Check out the copyserver script:
git clone https://github.com/ianmiell/shutit_copyserver.git
Step 3
Run the copy_server script:
cd shutit_copyserver/bin
./copy_server.sh
There are a couple of prompts – one to correct perms on a config file, and another to ask what docker base image you want to use. Make sure you use one as close to the original server as possible.
Note that this requires a version of docker that has the ‘docker exec’ option.
Step 4
Run the build server:
docker run -ti copyserver /bin/bash
You are now in a practical facsimile of your server within a docker container!
Source
https://zwischenzugs.com/2015/05/24/convert-any-server-to-a-docker-container/
in my opinon it's totally impossible. But you can create a dockerfile with same OS and mount your datas.

Resources