This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Grokking Bitcoin and have Kalle Rosenbaum on-line!
See this thread for details.
Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
  • Carey Brown
  • salvin francis
  • Claude Moore

Docker Images  RSS feed

Ranch Hand
Posts: 391
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am learning about Docker and have few basic doubts about it:

1. We say that we get the same platform in different environments as dev/test/prod etc. using docker, so, do we specify the OS to be used in docker file?

2. How the docker file works internally? When we download an image for mysql/oracle what actually it contains inside it? How about licensing of the software?

3. We can give the port number explicitly to run the applications. But, how it is used to autoscale the applications i.e. how it assigns the ports in that case?

4. How does a MySQL image differs from MySQL installation package?
Saloon Keeper
Posts: 20649
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that Docker images are always running Linux, although that may have changed. However, the base image for a given Docker container may be Red Hat, Ubuntu, Debian, Arch, or one of the distros specifically designed to run in a Docker container such as coreos. Those systems are the same Linux, just pared down since they don't need all the features that a stand-alone machine would use (especially hardware-specific stuff).

A docker image is intended to be capable of running in multiple container instances and to be easily ported from one host to another. That's why their logo is modelled after one of those big container ships.

Docker images are actually layers of overlaid filesystems. When you build a container from a dockerfile, you take a base image and concatenate it to a series of overlays to that base. Each step in the dockerfile creates another image, so if you install a bunch of packages in your image using a single RPM or apt step, they all go in one image layer, but if you then run sed steps to customize their /etc config files, each sed step would be another overlay on top of that. This is very efficient, since common base images can share resources. And an image built by one person can be used as a starting point for another person's dockerfile to enhance or customize things even further. When you export an image, in fact, what you actually get is a TAR where each filesystem overlay layer is a distinct "file" in the TARball.

An image can contain one or more applications. Images themselves are just files (or actually collections of files, as I mentioned above), and only by actually starting a container using an image can you do real work. Containers are essentially miniature VMs. They can communicate with each other using networking (including private internal networks), and when you start a container, if you want external users to be able to talk to it over a network, you can map host OS port numbers to the container's internal ports. For example, a MySQL image might be set up to use port 3305, but if you started 3 instances, you might map one to the host's port 3305, one to host port 3306, and one to host port 3307. Also you can inject external filesystems as mountable volumes in a container. For example, I have a container that runs the bacula backup system. Since container images are read-only, I'd lose all my config information and data files if I had to restart it. Instead I create the mutable files on my host OS and map them into the container's filesystem.

As far as licensing goes, you'd have to contact Oracle. Actually, a lot of us use MariaDB, which is the Open Source MySQL, and doesn't have licensing restrictions for containers above and beyond the standard GNU copyleft-style stuff.

A MySQL image is simply a docker image whose dockerfile included commands to install the MySQL package as part of the process of creating the image file.
Willie Smits increased rainfall 25% in three years by planting trees. Tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!