-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.html
1 lines (1 loc) · 9.09 KB
/
data.html
1
<div class="ac ae af ag ah ec aj ak"><h1 id="5cee" class="ia ib ef at as ic id ie if ig ih ii ij ik il im in" data-selectable-paragraph="">Misc</h1><p id="b1a3" class="gl gm ef at gn b go io gq ip gs iq gu ir gw is gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b"><strong class="gn iw">docker version</strong></code> — List info about your Docker Client and Server versions.</p><p id="7c0c" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b"><strong class="gn iw">docker login</strong></code>— Log in to a Docker registry. Enter your username and password when prompted.</p><p id="7f05" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b"><strong class="gn iw">docker system prune</strong></code> makes an appearance in the next article. Readers on <a href="https://twitter.com/Docker/status/1093233051906134016" class="dc by gz ha hb hc" target="_blank" rel="noopener">Twitter</a> and <a href="https://www.reddit.com/r/docker/comments/anh1se/15_docker_commands_you_should_know_part_5_of/" class="dc by gz ha hb hc" target="_blank" rel="noopener">Reddit</a> suggested that it would be good to add to this list. I agree, so I’m adding it.</p><p id="c1de" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b"><strong class="gn iw">docker system prune</strong></code> —Delete all unused containers, unused networks, and dangling images.</p><p id="3fa1" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b"><strong class="gn iw">docker system prune -a --volumes</strong></code></p><p id="f22d" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b">-a</code> is short for <code class="hp jo jp jq jr b">--all</code>. Delete unused images, <a href="https://stackoverflow.com/a/45143234/4590385" class="dc by gz ha hb hc" target="_blank" rel="noopener">not just dangling ones</a>.</p><p id="ddfe" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b">--volumes</code> Remove unused volumes. We’ll talk more about volumes in the next article.</p><h2 id="c44c" class="jc ib ef at as ic jd je jf jg jh ji jj jk jl jm jn" data-selectable-paragraph="">UPDATE Feb. 7, 2019: Management Commands</h2><p id="3809" class="gl gm ef at gn b go io gq ip gs iq gu ir gw is gy" data-selectable-paragraph="">In CLI 1.13 Docker introduced management command names that are logically grouped and consistently named. The old commands still work, but the new ones make it easier to get started with Docker. The original version of this article listed the old names. I’ve updated the article to use the management command names based on reader suggestions. Note that this change only introduces two command name changes — in most cases it just means adding <code class="hp jo jp jq jr b">container</code> or <code class="hp jo jp jq jr b">image</code> to the command. A mapping of the commands is <a href="http://blog.arungupta.me/docker-1-13-management-commands/" class="dc by gz ha hb hc" target="_blank" rel="noopener">here</a>.</p><h1 id="ca9c" class="ia ib ef at as ic id ie if ig ih ii ij ik il im in" data-selectable-paragraph="">Wrap</h1><p id="4d6b" class="gl gm ef at gn b go io gq ip gs iq gu ir gw is gy" data-selectable-paragraph="">If you are just getting started with Docker, these are the three most important commands:</p><p id="d0a2" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b"><strong class="gn iw">docker container run my_image</strong></code> — Create a new container and start it. You’ll probably want some flags here.</p><p id="412f" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b"><strong class="gn iw">docker image build -t my_repo/my_image:my_tag .</strong></code> — Build an image.</p><p id="80f6" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b"><strong class="gn iw">docker image push my_repo/my_image:my_tag</strong></code> — Push an image to a remote registry.</p><p id="5b7b" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph="">Here’s the larger list of essential Docker commands:</p><h2 id="ae9d" class="jc ib ef at as ic jd je jf jg jh ji jj jk jl jm jn" data-selectable-paragraph="">Containers</h2><p id="6490" class="gl gm ef at gn b go io gq ip gs iq gu ir gw is gy" data-selectable-paragraph="">Use <code class="hp jo jp jq jr b">docker container my_command</code></p><p id="1901" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b">create</code> — Create a container from an image. <br><code class="hp jo jp jq jr b">start </code>— Start an existing container. <br><code class="hp jo jp jq jr b">run</code> — Create a new container and start it. <br><code class="hp jo jp jq jr b">ls</code> — List running<em class="js"> </em>containers. <br><code class="hp jo jp jq jr b">inspect</code> — See lots of info about a container.<br><code class="hp jo jp jq jr b">logs</code> — Print logs. <br><code class="hp jo jp jq jr b">stop</code> — Gracefully stop running container. <br><code class="hp jo jp jq jr b">kill</code> —Stop main process in container abruptly. <br><code class="hp jo jp jq jr b">rm</code>— Delete a stopped container.</p><h2 id="cdd7" class="jc ib ef at as ic jd je jf jg jh ji jj jk jl jm jn" data-selectable-paragraph="">Images</h2><p id="0f8f" class="gl gm ef at gn b go io gq ip gs iq gu ir gw is gy" data-selectable-paragraph="">Use <code class="hp jo jp jq jr b">docker image my_command</code></p><p id="1ae7" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b">build </code>— Build an image.<br><code class="hp jo jp jq jr b">push</code> — Push an image to a remote registry.<br><code class="hp jo jp jq jr b">ls</code> — List images. <br><code class="hp jo jp jq jr b">history</code> — See intermediate image info.<br><code class="hp jo jp jq jr b">inspect</code> — See lots of info about an image, including the layers. <br><code class="hp jo jp jq jr b">rm</code> — Delete an image.</p><h2 id="611b" class="jc ib ef at as ic jd je jf jg jh ji jj jk jl jm jn" data-selectable-paragraph="">Misc</h2><p id="5d3a" class="gl gm ef at gn b go io gq ip gs iq gu ir gw is gy" data-selectable-paragraph=""><code class="hp jo jp jq jr b">docker version</code> — List info about your Docker Client and Server versions.<br><code class="hp jo jp jq jr b">docker login </code>— Log in to a Docker registry.<br><code class="hp jo jp jq jr b">docker system prune</code> — Delete all unused containers, unused networks, and dangling images.</p><p id="caef" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph="">To view the CLI reference when using Docker just enter the command <code class="hp jo jp jq jr b">docker</code> in the command line. You can see the Docker docs <a href="https://docs.docker.com/engine/reference/commandline/cli/" class="dc by gz ha hb hc" target="_blank" rel="noopener">here</a>.</p><p id="b670" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph="">Now you can really build things with Docker! As my daughter might say in emoji: 🍒 🥝 🍊 🍋 🍉 🍏 🍎 🍇. Which I think translates to “Cool!” So go forth and play with Docker!</p><p id="20a1" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph="">If you missed the earlier articles in this series, check them out. Here’s the first one:</p><div class="ko kp kq kr ks kt"><a rel="noopener" href="/learn-enough-docker-to-be-useful-b7ba70caeb4b?source=post_page-----970ea5203421----------------------"><section class="kw do dp ak bw n aq kx ky kz la lb lc ld le lf lg lh li lj lk ll"><div class="lm n dr p ln lo"><h2 class="as ic lp au ef"><div class="cd ku fr fs kv fu">Learn Enough Docker to be Useful</div></h2><div class="lq r"><h3 class="as cx fp au ax"><div class="cd ku fr fs kv fu">Part 1: The Conceptual Landscape</div></h3></div><div class="lr r"><h4 class="as cx cy au ax"><div class="cd ku fr fs kv fu">towardsdatascience.com</div></h4></div></div><div class="ls r"><div class="lt r lu lv lw ls lx ly lz"></div></div></section></a></div><p id="cddc" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph="">In the <a class="dc by gz ha hb hc" target="_blank" rel="noopener" href="/pump-up-the-volumes-data-in-docker-a21950a8cd8">final article in this series</a> we’ll spice things up with a discussion of data in Docker. Follow me to make sure you don’t miss it!</p><p id="e5f7" class="gl gm ef at gn b go gp gq gr gs gt gu gv gw gx gy" data-selectable-paragraph="">I hope you found this article helpful. If you did, please give it some love on your favorite social media channels. Docker on! 👏</p></div>