Tag Archives: link

Docker containers dependencies

composer
As a rule, you have more then one docker containers. It can be one base container (parent) and many other (children).
To connect they in docker-compose you can use the next snippets:

1. Using “links” – in common case is the most popular method. Here are network ports and volumes from parent container shares to child one.
docker-compose.yml

...
  links:
    - base
...

2. Using “volumes_from” – only volumes from parent container shares to child.
docker-compose.yml

...
  volumes_from:
    - base
...

The second way is useful when you connect your docker contaner network is applied to host network. The “links” directive cannot be used (since docker-compose v1.9).
docker-compose.yml

...
  net: "host"
...

Also, http://docs.docker.com/compose/compose-file

Web

Set width and height to empty link A tag in HTML

link_empty
You are probably deal with link (A-tag) in HTML. But how we can set size if it is empty, i.e. with no content?
Here is example solution:

<!DOCTYPE html>
<html>
    <head>
        <style>
        a.link1, a.link2, a.link3 {display:block; 
            width: 100px; height: 100px;
            margin: 5px; float: left;}
        a.link1 {background-color: red;}
        a.link2 {background-color: green;}
        a.link3 {background-color: blue;}
        </style>
    </head>
    <body>
        <a href="#1"></a>
        <a href="#2"></a>
        <a href="#3"></a>
    </body>
</html>

As you can see, the key feature is adding display:block; to A-tag style.
Enjoy!