首页 文章 精选 留言 我的

精选列表

搜索[DUOX技术],共10000篇文章
优秀的个人博客,低调大师

Docker技术笔记:Ubuntu安装Docker CE

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zhaobryant/article/details/79600050 安装环境 操作系统:Ubuntu Xenial 16.04 (LTS) Go语言版本:1.9.4 配置Ubuntu更新源(清华大学) $ sudo vim /etc/apt/sources.list # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse 卸载旧版本的Docker $ sudo apt-get remove docker docker-engine docker.io 安装新版本的Docker 步骤一:安装必要的系统工具 $ sudo apt-get update $ sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common 步骤二:安装GPG证书 $ curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - 步骤三:写入软件源信息 $ sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" 步骤四:更新并安装Docker-CE $ sudo apt-get -y update $ sudo apt-get -y install docker-ce 附:安装指定版本的Docker-CE # Step 1: 查找Docker-CE的版本: $ apt-cache madison docker-ce docker-ce | 17.03.1~ce-0~ubuntu-xenial | http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages docker-ce | 17.03.0~ce-0~ubuntu-xenial | http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages # Step 2: 安装指定版本的Docker-CE: (VERSION 如上 17.03.1~ce-0~ubuntu-xenial) $ sudo apt-get -y install docker-ce=[VERSION] 配置阿里云镜像加速器 需登录阿里云管理控制台,获取专属的加速器地址。 针对Docker客户端版本大于1.10.0的用户,可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器: $ sudo mkdir -p /etc/docker $ sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://irnlfwui.mirror.aliyuncs.com"] } EOF $ sudo systemctl daemon-reload $ sudo systemctl restart docker 测试Docker版本(验证安装是否成功) 命令:docker –version && docker version && docker info $ sudo docker --version Docker version 17.12.1-ce, build 7390fc6 $ sudo docker version Client: Version: 17.12.1-ce API version: 1.35 Go version: go1.9.4 Git commit: 7390fc6 Built: Tue Feb 27 22:17:40 2018 OS/Arch: linux/amd64 Server: Engine: Version: 17.12.1-ce API version: 1.35 (minimum version 1.12) Go version: go1.9.4 Git commit: 7390fc6 Built: Tue Feb 27 22:16:13 2018 OS/Arch: linux/amd64 Experimental: false $ sudo docker info Containers: 3 Running: 0 Paused: 0 Stopped: 3 Images: 6 ... 测试Docker安装 可以通过运行简单的Docker Image来进行安装测试: $ sudo docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world ca4f61b1923c: Pull complete Digest: sha256:083de497cff944f969d8499ab94f07134c50bcf5e6b9559b27182d3fa80ce3f7 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. ... 列出所有的镜像image和容器container: $ sudo docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello-world latest f2a91732366c 3 months ago 1.85kB $ sudo docker container ls -all CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c621f40a070c hello-world "/hello" 15 minutes ago Exited (0) 15 minutes ago friendly_edison Recap and Cheat Sheet ## List Docker CLI commands docker docker container --help ## Display Docker version and info docker --version docker version docker info ## Excecute Docker image docker run hello-world ## List Docker images docker image ls ## List Docker containers (running, all, all in quiet mode) docker container ls docker container ls --all docker container ls -a -q ## Stop all Docker containers docker stop $(docker ps -a -q) ## Remove all Docker containers docker rm $(docker ps -a -q) ## Remove specific Docker image docker rmi <image_id> ## Remove all untagged Docker images (id is <none>) docker rmi $(docker images | grep "^<none>" | awk "{print $3}") ## Remove all Docker images docker rmi $(docker ps -a -q) 参考资料 其他关于旧版本Docker卸载以及测试开发版本Docker安装的帮助,可以参考官方文档的说明进行安装。 Ubuntu中安装Docker帮助链接

优秀的个人博客,低调大师

java nio之通道和Gather技术

学到这一步,就可以和操作系统的一些IO调用结合起来了。 感觉到设计系统和语言的人是多么的牛X。 能考虑到的细节是多么的复杂! 下一步, file io和socket~~~~ 看书的深度和系统性,还是一篇网上的文章无法比的! 致敬! package com.ronsoft.books.nio.channels; import java.nio.ByteBuffer; import java.nio.channels.ReadableByteChannel; import java.nio.channels.WritableByteChannel; import java.nio.channels.Channels; import java.io.IOException; import java.nio.channels.GatheringByteChannel; import java.io.FileOutputStream; import java.util.Random; import java.util.List; import java.util.LinkedList; public class ChannelCopy { private static final String DEMOGRAPHIC = "blahblah.txt"; public static void main(String[] args) throws Exception { // TODO Auto-generated method stub /* ReadableByteChannel source = Channels.newChannel(System.in); WritableByteChannel dest = Channels.newChannel(System.out); channelCopy1(source, dest); // channelCopy2(source, dest); source.close(); dest.close(); */ int reps = 10; if (args.length > 0) { reps = Integer.parseInt(args[0]); } FileOutputStream fos = new FileOutputStream(DEMOGRAPHIC); GatheringByteChannel gatherChannel = fos.getChannel(); ByteBuffer []bs = utterBS(reps); while (gatherChannel.write(bs) > 0) { } System.out.println("Mindshare paradigms synergized to " + DEMOGRAPHIC); fos.close(); } private static void channelCopy1(ReadableByteChannel src, WritableByteChannel dest) throws IOException{ ByteBuffer buffer = ByteBuffer.allocate(16 * 1024); while (src.read(buffer) != -1) { buffer.flip(); dest.write(buffer); buffer.compact(); } buffer.flip(); while (buffer.hasRemaining()) { dest.write(buffer); } } private static void channelCopy2(ReadableByteChannel src, WritableByteChannel dest) throws IOException { ByteBuffer buffer = ByteBuffer.allocate(10 * 1024); while (src.read(buffer) != -1) { buffer.flip(); while (buffer.hasRemaining()) { dest.write(buffer); } buffer.clear(); } } private static String []col1 = { "Aggregate", "Enable", "Leverage", "Facilitate", "Synergize", "Repurpose", "Strategize", "Reinvent", "Harness" }; private static String []col2 = { "cross-platform", "best-of-breed", "frictionless", "ubiquitous", "extensible", "compelling", "mission-critical", "collaborative", "integrated" }; private static String [] col3 = { "methodologies", "infomediaries", "platforms", "schemas", "mindshare", "paradigms", "functionalities", "web services", "infrastructures" }; private static String newLine = System.getProperty("line.separator"); @SuppressWarnings({ "unchecked", "rawtypes" }) private static ByteBuffer []utterBS(int howMany) throws Exception { List list = new LinkedList(); for (int i = 0; i < howMany; i++) { list.add(pickRandom(col1, " ")); list.add(pickRandom(col2, " ")); list.add(pickRandom(col3, newLine)); } ByteBuffer []bufs = new ByteBuffer[list.size()]; list.toArray(bufs); return (bufs); } private static Random rand = new Random(); private static ByteBuffer pickRandom(String []strings, String suffix) throws Exception { String string = strings[rand.nextInt(strings.length)]; int total = string.length() + suffix.length(); ByteBuffer buf = ByteBuffer.allocate(total); buf.put(string.getBytes("US-ASCII")); buf.put(suffix.getBytes("US-ASCII")); buf.flip(); return (buf); } }

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册