Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Docker

You're reading from   Learning Docker Optimize the power of Docker to run your applications quickly and easily

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781784397937
Length 240 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (13) Chapters Close

Preface 1. Getting Started with Docker 2. Handling Docker Containers FREE CHAPTER 3. Building Images 4. Publishing Images 5. Running Your Private Docker Infrastructure 6. Running Services in a Container 7. Sharing Data with Containers 8. Orchestrating Containers 9. Testing with Docker 10. Debugging Containers 11. Securing Docker Containers Index

Installing and using nsenter


In any commercial Docker deployments, you may use various containers, such as web application, database, and so on. However, you need to access these containers in order to modify the configuration or debug/troubleshoot the issues. A simple solution for this problem is to run an SSH server in each container. It is a not good way to access the machines due to unanticipated security implications. However, if you are working in any one of the world-class IT companies, such as IBM, DELL, HP, and so on, your security compliance guy will never allow you to use SSH to connect to machines.

So, here is the solution. The nsenter tool provides you access to log in to your container. Note that nsenter will be first deployed as a Docker container only. Using this deployed nsenter, you can access your container. Follow these steps:

  1. Let's run a simple web application as a container:

    $ sudo docker run -d -p 5000:5000 training/webapp python app.py
    ------------------------
    a245253db38b626b8ac4a05575aa704374d0a3c25a392e0f4f562df92bb98d74...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime