mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-24 02:20:09 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
54fd868a3b
@ -1,3 +1,5 @@
|
||||
translating by yizhuoyan
|
||||
|
||||
Learn Blockchains by Building One
|
||||
======
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
Translating by MjSeven
|
||||
|
||||
Linux command line tools for working with non-Linux users
|
||||
======
|
||||

|
||||
|
@ -1,3 +1,5 @@
|
||||
translating---geekpi
|
||||
|
||||
Why building a community is worth the extra effort
|
||||
======
|
||||
|
||||
|
@ -1,137 +0,0 @@
|
||||
Translating By MjSeven
|
||||
|
||||
How to Use DockerHub
|
||||
======
|
||||
|
||||

|
||||
|
||||
In the previous articles, we learned the basics of [Docker terminology][1], [how to install Docker][2] on desktop Linux, macOS, and Windows, and [how to create container images][3] and run them on your system. In this last article in the series, we will talk about using images from DockerHub and publishing your own images to DockerHub.
|
||||
|
||||
First things first: what is DockerHub and why is it important? DockerHub is a cloud-based repository run and managed by Docker Inc. It's an online repository where Docker images can be published and used by other users. There are both public and private repositories. If you are a company, you can have a private repository for use within your own organization, whereas public images can be used by anyone.
|
||||
|
||||
You can also use official Docker images that are published publicly. I use many such images, including for my test WordPress installations, KDE plasma apps, and more. Although we learned last time how to create your own Docker images, you don't have to. There are thousands of images published on DockerHub for you to use. DockerHub is hardcoded into Docker as the default registry, so when you run the docker pull command against any image, it will be downloaded from DockerHub.
|
||||
|
||||
### Download images from Docker Hub and run locally
|
||||
|
||||
Please check out the previous articles in the series to get started. Then, once you have Docker running on your system, you can open the terminal and run:
|
||||
```
|
||||
$ docker images
|
||||
```
|
||||
|
||||
This command will show all the docker images currently on your system. Let's say you want to deploy Ubuntu on your local machine; you would do:
|
||||
```
|
||||
$ docker pull ubuntu
|
||||
```
|
||||
|
||||
If you already have Ubuntu image on your system, the command will automatically update that image to the latest version. So, if you want to update the existing images, just run the docker pull command, easy peasy. It's like apt-get upgrade without any muss and fuss.
|
||||
|
||||
You already know how to run an image:
|
||||
```
|
||||
$ docker run -it <image name>
|
||||
|
||||
$ docker run -it ubuntu
|
||||
```
|
||||
|
||||
The command prompt should change to something like this:
|
||||
```
|
||||
root@1b3ec4621737:/#
|
||||
```
|
||||
|
||||
Now you can run any command and utility that you use on Ubuntu. It's all safe and contained. You can run all the experiments and tests you want on that Ubuntu. Once you are done testing, you can nuke the image and download a new one. There is no system overhead that you would get with a virtual machine.
|
||||
|
||||
You can exit that container by running the exit command:
|
||||
```
|
||||
$ exit
|
||||
```
|
||||
|
||||
Now let's say you want to install Nginx on your system. Run search to find the desired image:
|
||||
```
|
||||
$ docker search nginx
|
||||
|
||||
aizMFFysICAEsgDDYrsrlqwoCgGbWVHtcOzgV9mA
|
||||
```
|
||||
|
||||
As you can see, there are many images of Nginx on DockerHub. Why? Because anyone can publish an image. Various images are optimized for different projects, so you can choose the appropriate image. You just need to install the appropriate image for your use-case.
|
||||
|
||||
Let's say you want to pull Bitnami's Nginx container:
|
||||
```
|
||||
$ docker pull bitnami/nginx
|
||||
```
|
||||
|
||||
Now run it with:
|
||||
```
|
||||
$ docker run -it bitnami/nginx
|
||||
```
|
||||
|
||||
### How to publish images to Docker Hub?
|
||||
|
||||
Previously, [we learned how to create a Docker image][3], and we can easily publish that image to DockerHub. First, you need to log into DockerHub. If you don't already have an account, please [create one][5]. Then, you can open terminal app and log in:
|
||||
```
|
||||
$ docker login --username=<USERNAME>
|
||||
```
|
||||
|
||||
Replace <USERNAME> with the name of your username for Docker Hub. In my case it's arnieswap:
|
||||
```
|
||||
$ docker login --username=arnieswap>
|
||||
```
|
||||
|
||||
Enter the password, and you are logged in. Now run the docker images command to get the ID of the image that you created last time.
|
||||
```
|
||||
$ docker images
|
||||
|
||||
tW1jDOugkX7J2FfyFyToM6B8m5OYFwMba-Ag5aez
|
||||
```
|
||||
|
||||
Now, suppose you want to push the ng image to DockerHub. First, we need to tag that image ([learn more about tags][1]):
|
||||
```
|
||||
$ docker tag e7083fd898c7 arnieswap/my_repo:testing
|
||||
```
|
||||
|
||||
Now push that image:
|
||||
```
|
||||
$ docker push arnieswap/my_repo
|
||||
```
|
||||
|
||||
The push refers to repository [docker.io/arnieswap/my_repo]
|
||||
```
|
||||
12628b20827e: Pushed
|
||||
|
||||
8600ee70176b: Mounted from library/ubuntu
|
||||
|
||||
2bbb3cec611d: Mounted from library/ubuntu
|
||||
|
||||
d2bb1fc88136: Mounted from library/ubuntu
|
||||
|
||||
a6a01ad8b53f: Mounted from library/ubuntu
|
||||
|
||||
833649a3e04c: Mounted from library/ubuntu
|
||||
|
||||
testing: digest: sha256:286cb866f34a2aa85c9fd810ac2cedd87699c02731db1b8ca1cfad16ef17c146 size: 1569
|
||||
|
||||
```
|
||||
|
||||
Eureka! Your image is being uploaded. Once finished, open DockerHub, log into your account, and you can see your very first Docker image. Now anyone can deploy your image. It's the easiest and fastest way to develop and distribute software. Whenever you update the image, users can simply run:
|
||||
```
|
||||
$ docker run arnieswap/my_repo
|
||||
```
|
||||
|
||||
Now you know why people love Docker containers. They solve many problems that traditional workloads face and allow you develop, test, and deploy applications in no time. And, by following the steps in this series, you can try them out for yourself.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/learn/intro-to-linux/2018/1/how-use-dockerhub
|
||||
|
||||
作者:[Swapnil Bhartiya][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/arnieswap
|
||||
[1]:https://www.linux.com/blog/intro-to-linux/2017/12/container-basics-terms-you-need-know
|
||||
[2]:https://www.linux.com/blog/learn/intro-to-linux/how-install-docker-ce-your-desktop
|
||||
[3]:https://www.linux.com/blog/learn/intro-to-linux/2018/1/how-create-docker-image
|
||||
[4]:https://lh3.googleusercontent.com/aizMFFysICAEsgDDYrsrlqwoCgGbWVHtcOzgV9mAtV8IdBZgHPJTdHIZhWBNCRvOyJb108ZBajJ_Nz10yCxGSvk-AF-yvFxpojLdVu3Jjihcwaup6CQLc67A5nglBuGDaOZWcrbV
|
||||
[5]:https://hub.docker.com/
|
||||
[6]:https://lh6.googleusercontent.com/tW1jDOugkX7J2FfyFyToM6B8m5OYFwMba-Ag5aezVGf2A5gsKJ47QrCh_TOKWgIKfE824Uc2Cwwwj9jWps1yJlUZqDyIceVQs-nEbKavFDxuUxLyd4thBA4_rsXrQH4r7hrG8FnD
|
@ -1,42 +0,0 @@
|
||||
translating---geekpi
|
||||
|
||||
Playing with water
|
||||
======
|
||||
![H2o Flow gradient boosting job][1]
|
||||
|
||||
I'm currently taking a machine learning class and although it is an insane amount of work, I like it a lot. I initially had planned to use [R][2] to play around with the database I have, but the teacher recommended I use [H2o][3], a FOSS machine learning framework.
|
||||
|
||||
I was a bit sceptical at first since I'm already pretty good with R, but then I found out you could simply import H2o as an R library. H2o replaces most R functions by its own parallelized ones to cut down on processing time (no more `doParallel` calls) and uses an "external" server you have to run on the side instead of running R calls directly.
|
||||
|
||||
![H2o Flow gradient boosting model][4]
|
||||
|
||||
I was pretty happy with this situation, that is until I actually started using H2o in R. With the huge database I'm playing with, the library felt clunky and I had a hard time doing anything useful. Most of the time, I just ended up with long Java traceback calls. Much love.
|
||||
|
||||
I'm sure in the right hands using H2o as a library could have been incredibly powerful, but sadly it seems I haven't earned my black belt in R-fu yet.
|
||||
|
||||
![H2o Flow variable importance weights][5]
|
||||
|
||||
I was pissed for at least a whole day - not being able to achieve what I wanted to do - until I realised H2o comes with a WebUI called Flow. I'm normally not very fond of using web thingies to do important work like writing code, but Flow is simply incredible.
|
||||
|
||||
Automated graphing functions, integrated ETA when running resource intensive models, descriptions for each and every model parameters (the parameters are even divided in sections based on your familiarly with the statistical models in question), Flow seemingly has it all. In no time I was able to run 3 basic machine learning models and get actual interpretable results.
|
||||
|
||||
So yeah, if you've been itching to analyse very large databases using state of the art machine learning models, I would recommend using H2o. Try Flow at first instead of the Python or R hooks to see what it's capable of doing.
|
||||
|
||||
The only downside to all of this is that H2o is written in Java and depends on Java 1.7 to run... That, and be warned: it requires a metric fuckton of processing power and RAM. My poor server struggled quite a bit even with 10 available cores and 10Gb of RAM...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://veronneau.org/playing-with-water.html
|
||||
|
||||
作者:[Louis-Philippe Véronneau][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://veronneau.org/
|
||||
[1]:https://veronneau.org/media/blog/2018-03-14/h2o_job.png (H2o Flow gradient boosting job)
|
||||
[2]:https://en.wikipedia.org/wiki/R_(programming_language)
|
||||
[3]:https://www.h2o.ai
|
||||
[4]:https://veronneau.org/media/blog/2018-03-14/h2o_model.png (H2o Flow gradient boosting model)
|
||||
[5]:https://veronneau.org/media/blog/2018-03-14/h2o_var_importance.png (H2o Flow variable importance weights)
|
134
translated/tech/20180129 How to Use DockerHub.md
Normal file
134
translated/tech/20180129 How to Use DockerHub.md
Normal file
@ -0,0 +1,134 @@
|
||||
如何使用 DockerHub
|
||||
=====
|
||||
|
||||

|
||||
|
||||
在前面的文章中,我们了解到了 [Docker terminology][1] 的基础,在Linux 桌面,MacOS 和 Windows上 [如何安装 Docker][2],[如何创建容器镜像][3] 并且在系统上运行它们。在本系列的最后一篇文章中,我们将讨论如何使用 DockerHub 中的镜像以及将自己的镜像发布到 DockerHub。
|
||||
|
||||
首先要做的是:什么是 DockerHub 以及为什么它很重要?DockerHub 是一个由 Docker Inc 运行和管理的基于云的存储库。它是一个在线存储库,Docker 镜像可以由其他用户发布和使用。它有公共和私人存储库。如果你是一家公司,你可以在你自己的组织内拥有一个私人存储库,这里的公共镜像可以被任何人使用。
|
||||
|
||||
你也可以使用公开发布的官方 Docker 镜像。我使用了很多这样的镜像,包括我的试验 WordPress 安装,KDE plasma 应用程序等等。虽然我们上次学习了如何创建自己的 Docker 镜像,但你不必这样做。DockerHub 上发布了数千镜像供你使用。DockerHub 作为默认注册表硬编码到 Docker 中,所以当你对任何镜像运行 docker pull 命令时,它将从 DockerHub 下载。
|
||||
|
||||
### 从 Docker Hub 下载镜像并在本地运行
|
||||
|
||||
请查看本系列的前几篇文章,以便开始阅读。然后,一旦 Docker 在你的系统上运行,你就可以打开终端并运行:
|
||||
```
|
||||
$ docker images
|
||||
```
|
||||
|
||||
该命令将显示当前系统上所有的 docker 镜像。假设你想在本地机器上部署 Ubuntu;你可能会:
|
||||
```
|
||||
$ docker pull ubuntu
|
||||
```
|
||||
|
||||
如果你的系统上已经存在 Ubuntu 镜像,那么该命令会自动将该系统更新到最新版本。因此,如果你想要更新现有的镜像,只需运行 docker pull 命令,易如反掌。这就像 apt-get update 一样,没有任何的混乱和麻烦。
|
||||
|
||||
你已经知道了如何运行镜像:
|
||||
```
|
||||
$ docker run -it <image name>
|
||||
|
||||
$ docker run -it ubuntu
|
||||
```
|
||||
|
||||
命令提示符应该变为如下内容:
|
||||
```
|
||||
root@1b3ec4621737:/#
|
||||
```
|
||||
|
||||
现在你可以运行任何属于 Ubuntu 的命令和实用程序,这些都被包含在内而且安全。你可以在 Ubuntu 上运行你想要的所有实验和测试。一旦你完成了测试,你就可以核对镜像并下载一个新的。在虚拟机中不存在系统开销。
|
||||
|
||||
你可以通过运行 exit 命令退出该容器:
|
||||
```
|
||||
$ exit
|
||||
```
|
||||
|
||||
现在假设你想在系统上安装 Nginx,运行 search 命令来找到需要的镜像:
|
||||
```
|
||||
$ docker search nginx
|
||||
|
||||
aizMFFysICAEsgDDYrsrlqwoCgGbWVHtcOzgV9mA
|
||||
```
|
||||
|
||||
正如你所看到的,DockerHub 上有很多 Nginx 镜像。为什么?因为任何人都可以发布镜像,各种镜像针对不同的项目进行了优化,因此你可以选择合适的镜像。你只需要为你的需求安装合适的镜像。
|
||||
|
||||
假设你想要拉取 Bitnami's Nginx 镜像:
|
||||
```
|
||||
$ docker pull bitnami/nginx
|
||||
```
|
||||
|
||||
现在运行:
|
||||
```
|
||||
$ docker run -it bitnami/nginx
|
||||
```
|
||||
|
||||
### 如何发布镜像到 Docker Hub?
|
||||
|
||||
在此之前,[我们学习了如何创建 Docker 镜像][3],我们可以轻松地将该镜像发布到 DockerHub 中。首先,你需要登录 DockerHub,如果没有账户,请 [创建账户][5]。然后,你可以打开终端应用,登录:
|
||||
```
|
||||
$ docker login --username=<USERNAME>
|
||||
```
|
||||
|
||||
将 <USERNAME> 替换为你自己的 Docker Hub 用户名。我这里是 arnieswap:
|
||||
```
|
||||
$ docker login --username=arnieswap
|
||||
```
|
||||
|
||||
输入密码,你就登录了。现在运行 docker 镜像命令来获取你上次创建的镜像的 ID。
|
||||
```
|
||||
$ docker images
|
||||
|
||||
tW1jDOugkX7J2FfyFyToM6B8m5OYFwMba-Ag5aez
|
||||
```
|
||||
|
||||
现在,假设你希望将 ng 镜像推送到 DockerHub,首先,我们需要标记该镜像([了解更多关于标记的信息][1]):
|
||||
```
|
||||
$ docker tag e7083fd898c7 arnieswap/my_repo:testing
|
||||
```
|
||||
|
||||
现在推送镜像:
|
||||
```
|
||||
$ docker push arnieswap/my_repo
|
||||
```
|
||||
|
||||
推送指向的是 [docker.io/arnieswap/my_repo] 仓库
|
||||
```
|
||||
12628b20827e: Pushed
|
||||
|
||||
8600ee70176b: Mounted from library/ubuntu
|
||||
|
||||
2bbb3cec611d: Mounted from library/ubuntu
|
||||
|
||||
d2bb1fc88136: Mounted from library/ubuntu
|
||||
|
||||
a6a01ad8b53f: Mounted from library/ubuntu
|
||||
|
||||
833649a3e04c: Mounted from library/ubuntu
|
||||
|
||||
testing: digest: sha256:286cb866f34a2aa85c9fd810ac2cedd87699c02731db1b8ca1cfad16ef17c146 size: 1569
|
||||
|
||||
```
|
||||
|
||||
哦耶!你的镜像正在上传。一旦完成,打开 DockerHub,登录到你的账户,你就能看到你的第一个 Docker 镜像。现在任何人都可以部署你的镜像。这是开发软件和发布软件最简单,最快速的方式。无论你何时更新镜像,用户都可以简单地运行:
|
||||
```
|
||||
$ docker run arnieswap/my_repo
|
||||
```
|
||||
|
||||
现在你知道为什么人们喜欢 Docker 容器了。它解决了传统工作负载所面临的许多问题,并允许你在任何时候开发、测试和部署应用程序。通过遵循本系列中的步骤,你自己可以尝试以下。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/learn/intro-to-linux/2018/1/how-use-dockerhub
|
||||
|
||||
作者:[Swapnil Bhartiya][a]
|
||||
译者:[MjSeven](https://github.com/MjSeven)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/arnieswap
|
||||
[1]:https://www.linux.com/blog/intro-to-linux/2017/12/container-basics-terms-you-need-know
|
||||
[2]:https://www.linux.com/blog/learn/intro-to-linux/how-install-docker-ce-your-desktop
|
||||
[3]:https://www.linux.com/blog/learn/intro-to-linux/2018/1/how-create-docker-image
|
||||
[4]:https://lh3.googleusercontent.com/aizMFFysICAEsgDDYrsrlqwoCgGbWVHtcOzgV9mAtV8IdBZgHPJTdHIZhWBNCRvOyJb108ZBajJ_Nz10yCxGSvk-AF-yvFxpojLdVu3Jjihcwaup6CQLc67A5nglBuGDaOZWcrbV
|
||||
[5]:https://hub.docker.com/
|
||||
[6]:https://lh6.googleusercontent.com/tW1jDOugkX7J2FfyFyToM6B8m5OYFwMba-Ag5aezVGf2A5gsKJ47QrCh_TOKWgIKfE824Uc2Cwwwj9jWps1yJlUZqDyIceVQs-nEbKavFDxuUxLyd4thBA4_rsXrQH4r7hrG8FnD
|
40
translated/tech/20180314 Playing with water.md
Normal file
40
translated/tech/20180314 Playing with water.md
Normal file
@ -0,0 +1,40 @@
|
||||
尝试 H2o
|
||||
======
|
||||
![H2o Flow gradient boosting job][1]
|
||||
|
||||
我目前正在参加一个机器学习班,虽然有疯狂的工作量,但我非常喜欢。我最初计划使用 [R][2] 来训练我的数据库,但老师建议我使用一个 FOSS 机器学习框架 [H2o][3]。
|
||||
|
||||
起初我有点怀疑,因为我已经对 R 掌握得不错了,但后来我发现你可以简单地将 H2o 作为 R 库导入。H2o 将大多数 R 函数替换为其自己的并行化函数,以减少处理时间(不再需要 `doParallel` 调用),并且使用“外部”服务端来运行,而不是直接调用 R。
|
||||
|
||||
![H2o Flow gradient boosting model][4]
|
||||
|
||||
直到我真正在实际中开始在 H2o 中使用 R 时,我对这种情况都非常满意。我在使用非常大得数据库时,库变得笨重,我几乎不能做任何有用得事情。大多数时候,我最后只是得到一个很长的 Java 回溯调用。
|
||||
|
||||
我相信正确地将 H2o 作为一个库使用将非常强大,但可惜的是,它似乎在我的 R-fu 中无效。
|
||||
|
||||
![H2o Flow variable importance weights][5]
|
||||
|
||||
我至少有一整天都很生气 - 无法实现我想做的事 - 直到我意识到 H2o 有一个名为 Flow 的 WebUI。我通常不喜欢使用 web 来完成重要的工作,比如编写代码,但是 Flow 简直太不可思议了。
|
||||
|
||||
自动绘图功能,运行资源密集模型时集成 ETA(预计剩余时间),每个模型参数的描述(这些参数甚至会根据您熟悉的统计模型分成不同部分),Flow 似乎拥有所有功能。我很快就能够运行 3 种基本的机器学习模型并获得实际可解释的结果。
|
||||
|
||||
所以,如果你一直渴望使用最先进的机器学习模型分析非常大的数据库,我会推荐使用 H2o。首先尝试使用 Flow,而不是 Python 或 R 的钩子,来看看它能做什么。
|
||||
|
||||
唯一缺点是,H2o 是用 Java 编写的,并依赖 Java 1.7 来运行。并且需要警告:它需要非常强大的处理器和大量的内存。即使有 10 个可用的内核和 10Gb 的 RAM,我可怜的服务器也苦苦挣扎了一段时间。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://veronneau.org/playing-with-water.html
|
||||
|
||||
作者:[Louis-Philippe Véronneau][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://veronneau.org/
|
||||
[1]:https://veronneau.org/media/blog/2018-03-14/h2o_job.png (H2o Flow gradient boosting job)
|
||||
[2]:https://en.wikipedia.org/wiki/R_(programming_language)
|
||||
[3]:https://www.h2o.ai
|
||||
[4]:https://veronneau.org/media/blog/2018-03-14/h2o_model.png (H2o Flow gradient boosting model)
|
||||
[5]:https://veronneau.org/media/blog/2018-03-14/h2o_var_importance.png (H2o Flow variable importance weights)
|
Loading…
Reference in New Issue
Block a user