Tutorial by Examples: docker

The quick start guide includes information about using Docker to stand up a Bosun instance. $ docker run -d -p 4242:4242 -p 80:8070 stackexchange/bosun This will create a new instance of Bosun which you can access by opening a browser to http://docker-server-ip. The docker image includes HBase/O...
Requirements: OS X 10.8 “Mountain Lion” or newer required to run Docker. While the docker binary can run natively on Mac OS X, to build and host containers you need to run a Linux virtual machine on the box. 1.12.0 Since version 1.12 you don't need to have a separate VM to be installed, as Docker...
Ordinarily, images are pulled automatically from Docker Hub. Docker will attempt to pull any image from Docker Hub that doesn't already exist on the Docker host. For example, using docker run ubuntu when the ubuntu image is not already on the Docker host will cause Docker to initiate a pull of the l...
Once you have a Dockerfile, you can build an image from it using docker build. The basic form of this command is: docker build -t image-name path If your Dockerfile isn't named Dockerfile, you can use the -f flag to give the name of the Dockerfile to build. docker build -t image-name -f Dockerfi...
FROM node:5 The FROM directive specifies an image to start from. Any valid image reference may be used. WORKDIR /usr/src/app The WORKDIR directive sets the current working directory inside the container, equivalent to running cd inside the container. (Note: RUN cd will not change the current ...
# Create the nodes # In a real world scenario we would use at least 3 managers to cover the fail of one manager. docker-machine create -d virtualbox manager docker-machine create -d virtualbox worker1 # Create the swarm # It is possible to define a port for the *advertise-addr* and *listen-ad...
Scollector has built in support for using cAdvisor to generate container.* metrics in Bosun for each Docker container on a host. To get started you will need to start a new container on each docker host: docker run --name cadvisor --restart=always -d -p 8080:8080 google/cadvisor And then from an...
Requirements: 64-bit version of Windows 7 or higher on a machine which supports Hardware Virtualization Technology, and it is enabled. While the docker binary can run natively on Windows, to build and host containers you need to run a Linux virtual machine on the box. 1.12.0 Since version 1.12 y...
Docker is supported on the following 64-bit versions of Ubuntu Linux: Ubuntu Xenial 16.04 (LTS) Ubuntu Wily 15.10 Ubuntu Trusty 14.04 (LTS) Ubuntu Precise 12.04 (LTS) A couple of notes: The following instructions involve installation using Docker packages only, and this ensures obtaining...
docker restart <container> [<container>...] Option --time : Seconds to wait for stop before killing the container (default 10) docker restart <container> --time 10
EXPOSE <port> [<port>...] From Docker's documentation: The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. EXPOSE does not make the ports of the container accessible to the host. To do that, you must use either the -p flag to ...
docker exec -it <container id> /bin/bash It is common to log in an already running container to make some quick tests or see what the application is doing. Often it denotes bad container use practices due to logs and changed files should be placed in volumes. This example allows us log in the...
All these are shell commands. docker-machine env to get the current default docker-machine configuration eval $(docker-machine env) to get the current docker-machine configuration and set the current shell environment up to use this docker-machine with . If your shell is set up to use a proxy, yo...
All these are shell commands If you need to log onto a running docker-machine directly, you can do that: docker-machine ssh to ssh into the default docker-machine docker-machine ssh machinename to ssh into a non-default docker-machine If you just want to run a single command, you can do so...
Wildfly, part of the JBoss umbrella of projects, can also be executed via Docker. On a machine with Docker properly configured, run: $ docker run -it jboss/wildfly Once the image is pulled, the container starts and the following line can be seen: 09:44:49,225 INFO [org.jboss.as] (Controller Bo...
vagrant up --provider docker
You can search Docker Hub for images by using the search command: docker search <term> For example: $ docker search nginx NAME DESCRIPTION STARS OFFICIAL AUTOMATED nginx Official build of Nginx. ...
Docker volumes are not automatically removed when a container is stopped. To remove associated volumes when you stop a container: docker rm -v <container id or name> If the -v flag is not specified, the volume remains on-disk as a 'dangling volume'. To delete all dangling volumes: docker ...
A minimal Dockerfile looks like this: FROM alpine CMD ["echo", "Hello StackOverflow!"] This will instruct Docker to build an image based on Alpine (FROM), a minimal distribution for containers, and to run a specific command (CMD) when executing the resulting image. Build an...
Group common operations Docker builds images as a collection of layers. Each layer can only add data, even if this data says that a file has been deleted. Every instruction creates a new layer. For example: RUN apt-get -qq update RUN apt-get -qq install some-package Has a couple of downsides: ...

Page 1 of 4