Tutorial by Examples: docker

In order to compile docker its recommended you have at least 2 GB RAM. Even with that it fails sometimes so its better to go for 4GB instead. make sure git and make is installed sudo apt-get install make git-core -y install a new kernel (at least 4.2) sudo apt-get install linux-generic...
sudo docker stats $(sudo docker inspect -f "{{ .Name }}" $(sudo docker ps -q)) Shows live CPU usage of all running containers.
Here is an example of a pipeline script that builds a Docker container, then runs the tests inside of it. The entrypoint is assumed to be either manage.py or invoke/fabric with a runtests command available. #!/usr/bin/groovy node { stage 'Checkout' checkout scm sh 'git submodule update ...
[root@localhost ~]# docker inspect d87bf9607836 "Mounts": [ { "Name": "cdf78fbf79a7c9363948e133abe4c572734cd788c95d36edea0448094ec9121c", "Source": "/var/lib/docker/volumes/cdf78fbf79a7c9363948e133abe4c572734cd788c95d36edea0448094ec9121c/_data&quot...
If you want to use docker for rails app, and use database, you need to know that all the data in the docker container will be destroyed (unless you configure the container specifically for keeping data) Sometimes, you need to create a docker container with an application and attach it to an old con...
iptables -I INPUT -i docker0 -m addrtype --dst-type LOCAL -j DROP Blocks Access to host running docker daemon Does not block Container to container traffic Local LAN Internet Custom docker networks that doesn't use docker0
docker network create --subnet=192.168.0.0/24 --gateway=192.168.0.1 --ip-range=192.168.0.0/25 local-host-restricted iptables -I INPUT -s 192.168.0.0/24 -m addrtype --dst-type LOCAL -j DROP Creates a network called local-host-restricted which which: Blocks Access to host running docker daem...
docker inspect command can be used to debug the container logs. The stdout and stderr of container can be checked to debug the container, whose location can be obtained using docker inspect. Command : docker inspect <container-id> | grep Source It gives the location of containers stdout an...
This relies on the official consul docker image to run consul in clustered mode in a docker swarm with new swarm mode in Docker 1.12. This example is based on http://qnib.org/2016/08/11/consul-service/. Briefly the idea is to use two docker swarm services that talk to each other. This solves the pro...
# Base image FROM python:2.7-alpine # Metadata MAINTAINER John Doe <[email protected]> # System-level dependencies RUN apk add --update \ ca-certificates \ && update-ca-certificates \ && rm -rf /var/cache/apk/* # App dependencies COPY requirements....
I find that the examples in the docker inspect documentation seem magic, but do not explain much. Docker inspect is important because it is the clean way to extract information from a running container docker inspect -f ... container_id (or all running container) docker inspect -f ... $(docker p...
Containers in the same docker network have access to exposed ports. docker network create sample docker run --net sample --name keys consul agent -server -client=0.0.0.0 -bootstrap Consul's Dockerfile exposes 8500, 8600, and several more ports. To demonstrate, run another container in the same ...
Networks can be specified in a compose file (v2). By default all the containers are in a shared network. Start with this file: example/docker-compose.yml: version: '2' services: keys: image: consul command: agent -server -client=0.0.0.0 -bootstrap test: image: alpine tty...
LaraDock is a Laravel Homestead like development environment but for Docker instead of Vagrant. https://github.com/LaraDock/laradock Installation *Requires Git and Docker Clone the LaraDock repository: A. If you already have a Laravel project, clone this repository on your Laravel root director...
Dockerization of ASP.NET Application requires a Dockerfile for configuration and running it as a docker container. FROM microsoft/dotnet:latest RUN apt-get update && apt-get install sqlite3 libsqlite3-dev COPY . /app WORKDIR /app RUN ["dotnet", "restore"] ...
It is nessecary to have .NET or a mono-aspnet package. It is important to understand the importance of dockerization. Install dotnet on ubuntu or the OS you are working on. Installing DOTNET $ sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty m...
The default Django project template is fine but once you get to deploy your code and for example devops put their hands on the project things get messy. What you can do is separate your source code from the rest that is required to be in your repository. You can find a usable Django project templ...
You can use docker, without using docker daemon (engine), by using cloud providers. In this example, you should have a gcloud (Google Cloud util), that connected to your account docker-machine create --driver google --google-project `your-project-name` google-machine-type f1-large fm02 This exa...
It is simple to start using Redis using docker: docker pull redis docker run -p 6379:6379 --rm --name redis redis Now you have running instance on port 6397 Attention: All data will be deleted, when Redis will be stopped. To connect the redis-cli, start another docker: docker run -it --link ...
This chapter describes how to set up a Docker Container with Jenkins inside, which is capable of sending Docker commands to the Docker installation (the Docker Daemon) of the Host. Effectively using Docker in Docker. To achieve this, we have to build a custom Docker Image which is based on an arbitr...

Page 3 of 4