forked from collabnix/dockerlabs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccessing-the-container.html
128 lines (89 loc) · 6 KB
/
accessing-the-container.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>Beginners Track - Accessing the Container Shell</title>
<meta name="generator" content="Jekyll v3.9.2" />
<meta property="og:title" content="Beginners Track - Accessing the Container Shell" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="collabnix DockerLab Docker - Beginners Track" />
<meta property="og:description" content="collabnix DockerLab Docker - Beginners Track" />
<link rel="canonical" href="http://localhost:4000/beginners/accessing-the-container.html" />
<meta property="og:url" content="http://localhost:4000/beginners/accessing-the-container.html" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Beginners Track - Accessing the Container Shell" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebPage","description":"collabnix DockerLab Docker - Beginners Track","headline":"Beginners Track - Accessing the Container Shell","url":"http://localhost:4000/beginners/accessing-the-container.html"}</script>
<!-- End Jekyll SEO tag -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#157878">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" href="/assets/css/style.css?v=">
</head>
<body>
<header class="page-header" role="banner">
<center><a href="http://dockerlabs.collabnix.com"><img src="https://raw.githubusercontent.com/collabnix/dockerlabs/master/images/moby_large.png"></a></center>
<!-- Place this tag where you want the button to render. -->
<a class="github-button" href="https://github.com/Collabnix/dockerlabs" data-size="large" data-show-count="true" aria-label="Star Collabnix/dockerlabs on GitHub">Star</a>
<!-- Place this tag where you want the button to render. -->
<a class="github-button" href="https://github.com/Collabnix/dockerlabs/fork" data-size="large" data-show-count="true" aria-label="Fork Collabnix/dockerlabs on GitHub">Fork</a>
<!-- Place this tag where you want the button to render. -->
<a class="github-button" href="https://github.com/collabnix/dockerlabs/subscription" data-icon="octicon-eye" data-size="large" data-show-count="true" aria-label="Watch collabnix/dockerlabs on GitHub">Watch</a>
<!-- Place this tag where you want the button to render. -->
<a class="github-button" href="https://github.com/collabnix" data-size="large" data-show-count="true" aria-label="Follow @collabnix on GitHub">Follow @collabnix</a>
<h1 class="project-name">Beginners Track - Accessing the Container Shell</h1>
<h2 class="project-tagline">collabnix | DockerLab | Docker - Beginners Track</h2>
<a href="https://launchpass.com/collabnix" class="btn">Join Slack</a>
<a href="https://collabnix.com/docker-cheatsheet/" class="btn">Docker Cheatsheet</a>
<a href="https://collabnix.com/docker-compose-cheatsheet/" class="btn">Docker Compose Cheatsheet</a>
</header>
<main id="content" class="main-content" role="main">
<h1 id="accessing-the-container-shell">Accessing the Container Shell</h1>
<h2 id="tested-infrastructure">Tested Infrastructure</h2>
<table class="tg">
<tr>
<th class="tg-yw4l"><b>Platform</b></th>
<th class="tg-yw4l"><b>Number of Instance</b></th>
<th class="tg-yw4l"><b>Reading Time</b></th>
</tr>
<tr>
<td class="tg-yw4l"><b> Play with Docker</b></td>
<td class="tg-yw4l"><b>1</b></td>
<td class="tg-yw4l"><b>5 min</b></td>
</tr>
</table>
<h2 id="pre-requisite">Pre-requisite</h2>
<ul>
<li>Create an account with <a href="https://hub.docker.com">DockerHub</a></li>
<li>Open <a href="https://labs.play-with-docker.com/">PWD</a> Platform on your browser</li>
<li>Click on <strong>Add New Instance</strong> on the left side of the screen to bring up Alpine OS instance on the right side</li>
</ul>
<h2 id="create-ubuntu-container">Create Ubuntu Container</h2>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run -dit ubuntu
</code></pre></div></div>
<h2 id="accessing-the-container-shell-1">Accessing the container shell</h2>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker exec -t <container-id> bash
</code></pre></div></div>
<h2 id="accesssing-the-container-shell">Accesssing the container shell</h2>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker attach <container-id>
</code></pre></div></div>
<p><a href="http://dockerlabs.collabnix.com/beginners/running-command-inside-running-container.html">Proceed » Running a Command inside running Container</a></p>
<footer class="site-footer">
<h3> Practice Docker Tutorial </h3>
<button> <a href=" https://www.onworks.net/runos/start-os.html?home=init&os=ubuntu-16.04.6-desktop-i386"> free Ubuntu VM </a></button>
<div class="hackr-widget" data-tutorial="dockerlabs-docker-and-kubernetes" data-type="1"></div><script src="https://hackr.io/widget.js?v=1.0"></script>
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.
<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/7198565.js"></script>
<!-- End of HubSpot Embed Code -->
<div id="wcb" class="carbonbadge"></div>
<script src="https://unpkg.com/website-carbon-badges@1.1.1/b.min.js" defer></script>
</span>
</footer>
</main>
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
</body>
</html>