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
Related
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.
Can a Docker image specify which operating system it can use? Say one Image with Windows and another with RHEL? In this case how Docker will maintain two different operating systems?
Docker is composed of layers. At the beginning of any Dockerfile you specify the OS by typing e.g. FROM python:3 My belief is that if you were to add another OS. The image would retain the environment from the first OS and install the env of the second OS over that. So essentially, your image would have both environments.
If you create a python image from the command above and name it docker build -t 'this_python' . then make a new Dockerfile with the first line: FROM this_python so the new image has python already, and you can install anything over this.
Best practice is to keep your docker image as small as possible. Install only what is required.
A quick example
FROM python:3
FROM ubuntu:latest
RUN apt-get update
The above Dockerfile gives you an image with Python and Ubuntu installed. But this is not how you should do it. Better is to use FROM ubuntu:latest and then install python over it.
Docker image is just docker image. It doesn't depend on the OS on which you run the docker engine. For example, when you run your docker image on Windows, actually it run on docker engine, which was hosted by a Virtual host of linux.
Can a Docker made from Ubuntu 16.04.01 run on 16.04.5? Can all versions of Ubuntu run a Docker from all other versions of Ubuntu?
Yes. It can.
The main idea of containerizing app is to package your app, dependency and all other necessary stuffs that are required to run your application into a single package. So, wherever there is docker engine, you can run your docker image. No matter what is your OS version. All the things that are require to run your app are already packaged with the image.
Look at the docker's official definition of What is a Container
In Nvidia's developer page (https://devblogs.nvidia.com/nvidia-docker-gpu-server-application-deployment-made-easy/)
It states that nvidia-docker provides "driver-agnostic CUDA images".
I would just like to inquire/clarify if this is only driver version specific or does this also apply to OS?
For example:
Host = CentOS
Docker Image/Container = Ubuntu
Does using nvidia-docker provide a way to utilize the CentOS's nvidia driver in the Ubuntu Docker Container?
Currently what I do is I always have 2 Docker files for supporting Ubuntu Host and CentOS Host and manually mount /dev/nvidia0 and copy the library files (or install the driver) inside the docker image.
I've asked this already to the Nvidia, but still waiting for them to answer.
I'll be trying it my self too to find out but I just thought to try my luck if anyone from SO already knows the answer.
Thank you in advance guys.
I've tested this and it does work.
"driver-agnostic CUDA images" is not only limitted to different versions of the driver but also across different OS (binary)
Thank you.
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.