Let's say I have a cross-platform environment,
my app is deployed twice - once on windows container and one on a Linux container,
In addition, I have a DB container (Linux).
Can I use docker compose to build those 3 services?
I think not - because the images I use are built for a certain os type.
Am I right? and maybe I am wrong and there is a workaround for this?
Compose files using version 2.4 support the platform options, which allows for specifying the platform of the service.
platform: osx
platform: windows/amd64
platform: linux/arm64/v8
https://github.com/docker/docker.github.io/blob/master/compose/compose-file/compose-file-v2.md#platform
It should be noted that the platform option is not supported on v3 compose files.
A more in-depth explanation can be found here: https://devblogs.microsoft.com/premier-developer/mixing-windows-and-linux-containers-with-docker-compose/
Related
I have docker-compose 1.25.4 on a system, and docker 19.03. How do I know which version of Compose file format it supports, without trying a bunch or searching through release notes etc?
I determined by trial and error that the highest Compose file format version that docker-compose 1.25.4 supports is 3.7. Therefore, my docker-compose.yml requires version: "3.7".
But what if I need to determine this programmatically? Or reliably, without trial and error, and without looking at release notes?
The docs at https://docs.docker.com/compose/compose-file/compose-versioning/ suggest that highest version should be 3.8 but this does not work. Indeed the release notes indicate that 3.8 became supported as of docker-compose 1.25.5.
I looked through various docker-compose commands and could not spot anything that would say "This version of docker-compose supports Compose file version up to x.y".
I figured out that there is no way to find this out via the cli.
You need to check the docker-compose github releases for this.
For example on Ubuntu: v1.25.0 version of docker-compose which is currently the latest and gets to be installed by default, but it is compatible with the 3.7 at highest.
https://github.com/docker/compose/releases/tag/1.25.0
The Compose file format compatibility matrix part is the interesting here.
I was using version: '3' for the docker-compose, works fine in my host machine (macOS), but when I tried to build the images and run the containers in the server, I got the response
Version in "./docker-compose.dev.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
OS Ubuntu "16.04.6 LTS (Xenial Xerus)" in AWS (ec2)
Docker version 19.03.8
docker-compose version 1.8.0, build unknown
I found a way around and it is to use version 2, How can I solve this?
Short description:
Is it possible to reference an SDK ( or any folder ) in a Docker Container from the Host computer?
Long description:
My team and I work in different environments ( Windows & Mac ) and on different stacks ( Asp .Net MVC / Elixir & Phoenix )
I'm trying to help everyone by creating separate Docker Stacks for each solution ( or group of projects )
What I have been able to do is set up the Docker Stacks so that each solution can be run in 1 or more Docker Containers and the developers can work on the code locally ( using direct host path mounts/volumes ) using an IDE of their choosing.
The issue is different solutions use different SDKs or even different versions of the same SDKs.
So what I would like to do is it up so that anyone in the team could reference the SDK installed on the Docker Container instead of installing the SDKs and each version of the SDKs they need for all the projects.
As far as I can tell, if I create a host mount binding, it will overwrite what's in the container with what's in the host, but I'd like to do it the other way round, I'd like to create a binding between the Docker Container and the Host and have the contents in the Docker Container show up in the Host.
Is this possible? Is there a better way to achieve this?
SDK images from vendors (e.g. asp.net core SDK images from Microsoft) best recommended compile/build time purpose and its lightweight version recommended for runtime in hosting/deployment environment.
Sole purpose of compile/build SDK images is for creating docker runtime images at build stage especially if target runtime OS (linux) is different than development machine OS e.g. Windows. If used efficiently with multistage builder pattern inside dockerfile, can create much lightweight runtime images for hosted environments.
e.g. aspnet.core SDK images used for building docker images and then run locally with host:guest port mapping. But if the dev machine OS is any linux distro then using SDK images is better as you can test validate in multiple SDK images. And these images just need exact name and docker deamon would download auto and use whenever required - that's it but certainly would needs good IDE orchestration support e.g. Visual Studio provides for docker based development on windows 10. or-else simply use docker CLI for build run.
Hope this helps clarify your need if not a solution
I installed Docker on a Red Hat Enterprise Linux Server 7.5 (Maipo) system:
docker version
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-58.git87f2fab.e17.x86_64
OS/Arch: linux/amd64
Now if I try to run a docker image, I get errors similar to this:
docker run docker.io/jupyter/datascience-notebook
tini: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
I have searched for help and have already taken a multitude of possible actions:
libraries seem to be linked correctly
all libraries are up to date
Hello-World example works
I also came across information saying that running containers from docker.io / hub.docker.com under RHEL is not supported - which I don't really get, as main purpose of docker is to enable running programs independent from their OS...?
https://access.redhat.com/solutions/1408853 Does this mean using docker under RHEL does not really provide me with the possibility of easily deploying/sharing a docker-image with non-RHEL users?
Also, does this mean I can only access and use official RHEL-docker images?
https://access.redhat.com/containers/?start=90#/search/
As I wanted to use docker to have ready-to-go environments with R-Python/Jupyter/H2o (and similar), I'm disappointed because I could not find suitable images for RHEL there.
So, my questions would be:
Is it possible to run docker.io / hub.docker.com images under RHEL7.5?
if not, could I share my own created docker images under RHEL7.5 to other users with different OS versions?
Are there other projects / sites to share docker-images for data science purposes on RHEL?
Would you agree that my next step would be: building my own docker-image, adding R/Python/jupyter step by step?
Best regards,
workah0lic
This error message
tini: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
comes from within the container image. It could be a corrupted container image, but the message is also printed when the glibc dynamic linker determines that the kernel features are not sufficient for loading libc.so.6. I looked at the image (digest is sha256:79f929bd0e58fa9cb238dceda48b0c8360e748d09b476b429216c93dac0bd783), and it appears to require kernel 3.2, so the Red Hat Enterprise Linux 7 kernel version of 3.10 should be sufficient.
In fact, I cannot reproduce this problem with kernel-3.10.0-862.6.3.el7.x86_64 and docker-1.13.1-58.git87f2fab.el7.x86_64. You could try to run this command to obtain additional information about dynamic linker behavior:
docker run -e LD_DEBUG=all docker.io/jupyter/datascience-notebook
Is there anyway to build an image with Dockerfile while using Kitematic?
From the top of the docs for Kitematic
Legacy desktop solution. Kitematic is a legacy solution, bundled with Docker Toolbox. We recommend updating to Docker for Mac or Docker for Windows if your system meets the requirements for one of those applications.
If possible, you should avoid using the tool.
If you have to use Kitematic, the feature you are asking about is tracked by this GitHub issue: Import Dockerfile - (Docker build). At the time of writing the feature is not implemented.