| :title: Link Command |
| :description: Add a link or rename the link for a container |
| :keywords: link, docker, container, documentation, link, links |
| |
| ============================================================================ |
| ``link`` -- Add a link or rename the link for a container |
| ============================================================================ |
| |
| :: |
| |
| Usage: docker link CURRENT_NAME NEW_NAME |
| |
| Link a container to a new name. |
| |
| |
| Examples: |
| -------- |
| |
| .. code-block:: bash |
| |
| $ docker link /59669e088202c2ebe150b4346cb3301562d073b51261176a354a74e8f618bfbc /redis |
| $ docker ls |
| NAME ID IMAGE |
| /redis 59669e088202c2ebe150b4346cb3301562d073b51261176a354a74e8f618bfbc crosbymichael/redis:latest |
| /59669e088202c2ebe150b4346cb3301562d073b51261176a354a74e8f618bfbc 59669e088202c2ebe150b4346cb3301562d073b51261176a354a74e8f618bfbc crosbymichael/redis:latest |
| |
| |
| This will create a new link for the existing name ``/59669e088202c2ebe150b4346cb3301562d073b51261176a354a74e8f618bfbc`` |
| with the new name ``/redis`` so that we can new reference the same container under the new name ``/redis``. |