docker-compose/boot2docker use in Ubuntu - linux

I have a docker-compose.yml file in my project and I am trying to use it using docker on my linux machine (Ubuntu 14.04).
Can someone shed a light on this how I can use this in my project?
I have installed docker and docker-compose already. Also, I tried using boot2docker(however, it's only for Mac and Windows), it did not work.
Please help!

First thing is, you don't need to use boot2docker if you are already using the Linux machine. Now, if you have already installed docker and docker compose, just go through this documentation to get started.
In particular, try this example.

Related

There has been a runner system failure, please try again

How to resolve this error specially on macbook. I have installed docker on my machine also but its not working.
You have to start docker deamon on your gitlab runner.
Below is link to docker desktop for mac.
If you start docker desktop gui, docker deamon will start.
https://docs.docker.com/desktop/mac/
This problem is not just for mac computers but also for windows. I experienced this problem and found out that the the PowerShell script part for Infra as Code that I was using was not installing docker.
I therefore made changes to the Infra as Code to ensure that Microsoft-Hyper-V is enabled and that docker is actually installed and docker service started, then the computer HAS to be restarted for the changes to pick up.
I do not know the exact order of when the restart should happen since I am still understanding the flow but I can update my answer when I have more info

Run docker container extracted from Ubuntu in Windows

I have an Ubuntu machine that contains a docker container.
For reasons I cannot run the server, but I can access the files trough a file explorer.
I found the docker folder in var/lib/ is there a way to copy and run that on a windows machine in a windows docker?
I cant run any of the docker commands on the Linux system as I cannot access it.
Is it possible or do I have to have the system running?
Thanks in advance! Sorry if it's a bad question I'm very new to this and can't find a similar enough case.

Hyperledger Fabric setup

I would like to setup Hyperledger Fabric on an Ubuntu machine with docker (docker-compose up). Is it possible to run the chaincode and nodejs code from another system (Mac system), as I already have Go and nodejs ready on the Mac.
Please help me with this query.
you can use same environment in different systems. This is the main reason to choose docker and docker-compose.
Just follow steps. Please confirm the version of tools.
To run on another system, you only have to simply build the image of your current hyperledger package on current system(Ubuntu). and use this image on another system(MAC).
Yes you can totally do that. Use this example: https://github.com/hyperledger/fabric-sdk-node/tree/master/examples/balance-transfer
Run docker-compose in your ubuntu machine. Update the app config.json and /app/network-config.json with ubuntu machine IP and make sure required ports are opened.
Run app on your mac.

Which commands of the defined Linux Distribution are available in a Docker container?

I'm new to docker and understand that the linux kernel is shared between the host-os and the containers. But I don't really understand how deep docker emulates a specific linux-distribution. Lets say we have a simple docker file like this:
FROM ubuntu:16.10
RUN apt-get install nginx
It will give me a docker container with nginx installed in an Ubuntu 16.10 environment. So I should be able to use apt-get as default package manager of Ubuntu. But how deep is this? Can I assume that typical commands of those distribution like lsb_release are emulated like in a full VM with Ubuntu 16.10 installed?
The reason behind my question is that linux distributions are different. I need to know which commands are avaliable, for example when I run a container with Ubuntu 16.10 like the one above on a host which a different distribution installed (like Red Hat, CentOS etc).
A Ubuntu image in Docker is about 150 MB. So I think there are not all tools included like in a real installation. But how can I know on which I can desert that they're there.
Base OS images for Docker are deliberately stripped down, and for Ubuntu they are removing more commands with each new release. The image is meant as the base for a dedicated application to run, you wouldn't typically connect to the container and run commands inside it, and a smaller image is easier to move around and has a smaller attack vector.
There isn't a list of commands in each image version that I know of, you'll only know by building your image. But when images are tagged you can assume a future minor update will not break downstream images - a good argument for explicitly specifying a tag in your Dockerfile.
E.g, this Dockerfile builds correctly:
FROM ubuntu:trusty
RUN ping -c 1 127.0.0.1
This one fails:
FROM ubuntu:xenial
RUN ping -c 1 127.0.0.1
That's because ping was removed from the image for the xenial release. If you just used FROM ubuntu then the same Dockerfile would have built correctly when trusty was the latest tag and then failed when it was replaced by xenial.
A container is presenting you with the same software environment as the non-containerized distribution. It may not have (in fact, probably does not have) all the same packages installed by default, but you can install whatever you need using the appropriate package manager. The availability of software in the container has nothing to do with the distribution running on your host (the Ubuntu image will be the same regardless of whether your are running Docker under CentOS, Fedora, Ubuntu, Arch, etc).
If you require certain commands to be available, just ensure that they are installed in your Dockerfile.
One of the few things that works differently inside a container is that there is typically no service management process running (like init or systemd or whatever), so you cannot start services the same way you can on the host without a little bit of work.

Linux dev environment in osx (docker as mv or any other)

I'd love to hear from you some advice on setting up what I'm looking for.
I'm using OSX and I need to develop some code on a Linux machine, the thing is that I was looking for some VM alternative since it takes too much battery power.
The first thing I come across with was a docker container. I know It is not what it was designed for, but I thought it might work anyway. So I tried running a container as
docker run -i -t ubuntu /bin/bash
and it worked well. However all the changes I make are gone and I can't fins a way to solve it. I also tried
docker run -i -v /Users/JaimehRubiks/test:/home/Jaime -t ubuntu /bin/bash
and all files in there are saved (also very interesting because I can share my files with host), but it's kind of boring having to commit to the docker image if I change anything in the config files of my ubuntu.
What I'm looking for is just a simple way to run linux in my mac, and then access to it somehow, like I did in docker or via SSH.
Docker currently does not run natively on osx as Docker relies on the Linux kernel for its isolation features. In fact, the Docker Toolbox uses a Virtual Box virtual machine running the boot2docker Linux distro to run the Docker daemon on osx. See the official documentation on Mac osx installation.
The boot2docker linux image is quite light weight, but I'm not sure you will get much benefit from running Docker on osx for Linux development over simply running a full Virtualbox machine with Ubuntu (or other distro). If you want to run a virtual machine vagrant is a good tool to help you set that up. It lets you easily pull down images from an image repo, setup the image, and ssh into it. It also makes host -> guest-machine folder sharing and port forwarding quite simple.
but it's kind of boring having to commit to the docker image if I change anything in the config files of my ubuntu.
You don't have to docker commit anything: any file change make on the host (/Users/JaimehRubiks/test) will be visible in the container (/home/Jaime)
what about using vagrant to run Ubuntu or CentOS? you can access the system via command vagrant ssh and configure it with configuration file and share it like using docker.

Resources