<p>I have 8 months coding exp. I am still learning how to code and just started learning golang. All I know is what Deep learning, web dev , and mobile are for. However, I don't know what docker is for?</p>
<hr/>**评论:**<br/><br/>KEANO_: <pre><p>Although Docker is written in Go a more suitable subreddit to ask this question would be <a href="/r/docker" rel="nofollow">/r/docker</a></p>
<p>But as a short answer: Docker is a technology to "pack" your applications in a special format to run on various plattforms without targeting those plattforms explicitly in your build process. (Not exactly an ELI5 but a simplification of at least one purpose of Docker)</p>
<p>You wont need this technology for your entry level Go Development as Go is already statically compiled (with minor exceptions but those wont affect you).</p></pre>sethammons: <pre><p>You should not disparage yourself by calling yourself stupid or saying you have a low IQ. Being inexperienced means you have not had the exposure to understand something. This is normal. People learn new things in relation to things they already know. Docker does not make sense yet because you lack experience in the problem space where it provides a solution. Chances are, you don't need to worry about it for a while yet. But, to try to answer your question, Docker allows you to say "my app needs a given OS and these OS packages and dependencies" and then let's you deploy that to varying other OSs with having to worry much. I find docker less compelling for Go development because you can just create a Go binary for the target OS.</p></pre>justinisrael: <pre><p>I don't meant to be rude by responding with a link, but can you expand on what is missing from :
<a href="https://www.docker.com/what-docker" rel="nofollow">https://www.docker.com/what-docker</a></p></pre>GoogleSearch-Arma2OA: <pre><p>I have read it so many times. I still don't understand. I guess that is because my IQ is low. I remember it is about some system and virtual machine. All i know it is it allows you to run some software either in Linux or Window. </p></pre>yiyus: <pre><p>If you understand what a virtual machine is, the section "Comparing containers and virtual machines" should give you a very good idea of what containers are.</p>
<p>Basically, containers solve the same problem as virtual machines, giving you the possibility to run applications for a guest system in a host system. The difference is that, while a virtual machine emulates a physical machine in which you load an OS for your applications, containers skip the hardware layer and directly emulate the OS.</p></pre>GoogleSearch-Arma2OA: <pre><p>Therefore, docker is only good for testing in different OS, but it can't really do anything about web development. </p></pre>justinisrael: <pre><p>Its not about testing it on different operating systems, because the container is always the same wherever you run it. If you make an Ubuntu Linux container, you can now run your app on any OS that supports docker by just running the container. So that means your Web app can be deployed anywhere. </p>
<p>Furthermore, Docker provides an ecosystem for publishing and versioning your containers so that a user simply needs to "get" a container by name through the docker command. If you want, say, a Redis database running right now, you can just start a docker container that will pull down from the docker community and start. Someone has already put together the recipe. </p></pre>GoogleSearch-Arma2OA: <pre><p>thx man. I finally understand what it does. It is very hard to understand from what i saw in docker website.</p></pre>Zy14rk: <pre><p>Docker is super-duper great if your app relies on a host of various little dependencies in the OS and apps/interpreters therein. These are usually quite hard to version properly - much less keep track of outside of your dev environment.</p>
<p>What you can do with docker is lock down all those little dependencies into a self-contained - well - container. Test towards it, plant your code into it and deploy.</p>
<p>With Go however, the use is limited, since Go produce static binaries with few dependencies. So you might as well just run off a standard VM linux image. Though for mass-deployment of a large distributed system, docker or similar uniform environment container do give a layer of not only conformity and security but also ease of use and control.</p>
<p>If what you are doing is a bit more limited however, don't bother for now. It is nice to learn to use eventually, but not a priority.</p></pre>mgutz: <pre><p>You know how there are binary version of go executables? Download the version and run? Docker takes that a step further. Docker packages up a specific version of an app and the OS it needs to run on into a container (very lightweight virtual machine). The configuration of that application and the OS is described in the Dockerfile script. You don't have to cross-build for a platform like Go does. The container is guaranteed to run the same regardless of the host OS.</p></pre>MEAT_FIST: <pre><p>So with coding languages that aren't Go, there is a huge problem with deploying your code across environments and platforms. Take Javascript as an example. There are issues with Node.js version, as well as which platform you're trying to run a Node.js application on because each library you import also needs to be compatible with that version of Node.js and that platform (OS X, Windows, etc).</p>
<p>The idea of Docker is rather than just writing code and hoping it'll work on a different platform, you package up your application and its dependencies into something called a Container. In the above mentioned example, you'd package up Node.js, your application and all of its dependencies.</p>
<p>A docker container will work correctly on any machine that has Docker installed. This is the guarantee that Docker provides that makes it valuable. If you wrap all of your applications/chunks-of-applications in Docker containers, you won't have to worry about platforms or dependencies, everything'll be all packaged up in Docker containers and can integrate without regard to any of the above mentioned problems.</p>
<p>Hope that helps.</p></pre>jackielii: <pre><p>I learned in life is that what I don't know is probably what I don't need yet.</p>
<p>So I think you probably don't need docker yet.</p></pre>GoogleSearch-Arma2OA: <pre><p>I think you are right. In fact, i am still a newbit who is learning coding who just has 8 months coding exp. I don't even know what my coding goal is.</p></pre>GoogleSearch-Arma2OA: <pre><p>wait a min, If I use a nodejs library in nodejs with a version that doesn't support my nodejs version , I am not able to use that library. However, if I build a backend server with gang and docker ,I don't have this kind of problem with docker in building a backend server.</p></pre>emansom: <pre><p>It's a super fancy jail, with vendor lock-in as a feature.</p></pre>KEANO_: <pre><p>ever seen a jail built on linux and running on windows? :D</p></pre>GoogleSearch-Arma2OA: <pre><p>IOS?</p></pre>KEANO_: <pre><p>ever seen docker on ios?</p></pre>emansom: <pre><p>Doesn't it actually run in a Vagrant/Virtualbox container?</p></pre>KEANO_: <pre><p>psst.... nobody needs to know</p>
<p>yeah actually it uses hyperV or virtualbox at the moment for the docker engine but the cli runs natively. ( <a href="http://ci.memecdn.com/8071523.jpg" rel="nofollow">http://ci.memecdn.com/8071523.jpg</a> )
there are plans to integrate the needed kernel functions into the NT kernel but this has yet a long way to come imho</p>
<p>my example should have been linux and macOS or something</p></pre>GoogleSearch-Arma2OA: <pre><p>What?</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
0 回复
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传