linux值centos7安装docker-程序员宅基地

技术标签: linux  

1,卸载旧版本

$ yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
2,需要的安装包
[root@localhost roo]# yum install -y yum-utils
这一步可以yum可能报错,如果报错了,执行下面的语句,没问题这不用执行
[root@localhost roo]# rm -f /var/run/yum.pid
3,设置镜像仓库
[root@localhost roo]# yum-config-manager \
    --add-repo \
    http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo


4,安装docker相关
[root@localhost roo]# sudo yum install docker-ce docker-ce-cli containerd.io

5,启动docker

[root@localhost roo]# system start docker

6,查看是否安装成功
[root@localhost roo]# systemctl start docker
7,执行hello-word
[root@localhost roo]# docker run hello-world

在这里插入图片描述
说明安装成功

8,查看一下镜像
[root@localhost roo]# docker images
REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
hello-world   latest    bf756fb1ae65   11 months ago   13.3kB
9,卸载(一般不用)
1,卸载依赖
yum remove docker-ce docker-ce-cli containerd.io
2、删除镜像/容器等
rm -rf /var/lib/docker
10,阿里云加速
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
    
  "registry-mirrors": ["https://9xj7kbt8.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

在这里插入图片描述

无用,做时代码
[root@localhost roo]# rm -f /var/run/yum.pid
[root@localhost roo]# yum install -y yum-utils
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 yum-utils.noarch.0.1.1.31-53.el7 将被 升级
---> 软件包 yum-utils.noarch.0.1.1.31-54.el7_8 将被 更新
--> 解决依赖关系完成

依赖关系解决

============================================================================================================================================
 Package                          架构                          版本                                      源                           大小
============================================================================================================================================
正在更新:
 yum-utils                        noarch                        1.1.31-54.el7_8                           base                        122 k

事务概要
============================================================================================================================================
升级  1 软件包

总下载量:122 k
Downloading packages:
No Presto metadata available for base
警告:/var/cache/yum/x86_64/7/base/packages/yum-utils-1.1.31-54.el7_8.noarch.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY:00 ETA 
yum-utils-1.1.31-54.el7_8.noarch.rpm 的公钥尚未安装
yum-utils-1.1.31-54.el7_8.noarch.rpm                                                                                 | 122 kB  00:00:07     
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 检索密钥
导入 GPG key 0xF4A80EB5:
 用户ID     : "CentOS-7 Key (CentOS 7 Official Signing Key) <[email protected]>"
 指纹       : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 软件包     : centos-release-7-8.2003.0.el7.centos.x86_64 (@anaconda)
 来自       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在更新    : yum-utils-1.1.31-54.el7_8.noarch                                                                                        1/2 
  清理        : yum-utils-1.1.31-53.el7.noarch                                                                                          2/2 
  验证中      : yum-utils-1.1.31-54.el7_8.noarch                                                                                        1/2 
  验证中      : yum-utils-1.1.31-53.el7.noarch                                                                                          2/2 

更新完毕:
  yum-utils.noarch 0:1.1.31-54.el7_8                                                                                                        

完毕!
[root@localhost roo]# 
[root@localhost roo]# 
[root@localhost roo]# 
[root@localhost roo]# yum-config-manager \
>     --add-repo \
>     http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
已加载插件:fastestmirror, langpacks
adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
[root@localhost roo]# yum makecache fast
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
base                                                                                                                 | 3.6 kB  00:00:00     
docker-ce-stable                                                                                                     | 3.5 kB  00:00:00     
extras                                                                                                               | 2.9 kB  00:00:00     
updates                                                                                                              | 2.9 kB  00:00:00     
(1/2): docker-ce-stable/x86_64/updateinfo                                                                            |   55 B  00:00:00     
(2/2): docker-ce-stable/x86_64/primary_db                                                                            |  50 kB  00:00:00     
元数据缓存已建立
[root@localhost roo]# 
[root@localhost roo]# 
[root@localhost roo]# sudo yum install docker-ce docker-ce-cli containerd.io
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 containerd.io.x86_64.0.1.4.3-3.1.el7 将被 安装
--> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 containerd.io-1.4.3-3.1.el7.x86_64 需要
---> 软件包 docker-ce.x86_64.3.20.10.0-3.el7 将被 安装
--> 正在处理依赖关系 docker-ce-rootless-extras,它被软件包 3:docker-ce-20.10.0-3.el7.x86_64 需要
---> 软件包 docker-ce-cli.x86_64.1.20.10.0-3.el7 将被 安装
--> 正在检查事务
---> 软件包 container-selinux.noarch.2.2.119.2-1.911c772.el7_8 将被 安装
---> 软件包 docker-ce-rootless-extras.x86_64.0.20.10.0-3.el7 将被 安装
--> 正在处理依赖关系 fuse-overlayfs >= 0.7,它被软件包 docker-ce-rootless-extras-20.10.0-3.el7.x86_64 需要
--> 正在处理依赖关系 slirp4netns >= 0.4,它被软件包 docker-ce-rootless-extras-20.10.0-3.el7.x86_64 需要
--> 正在检查事务
---> 软件包 fuse-overlayfs.x86_64.0.0.7.2-6.el7_8 将被 安装
--> 正在处理依赖关系 libfuse3.so.3(FUSE_3.2)(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
--> 正在处理依赖关系 libfuse3.so.3(FUSE_3.0)(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
--> 正在处理依赖关系 libfuse3.so.3()(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
---> 软件包 slirp4netns.x86_64.0.0.4.3-4.el7_8 将被 安装
--> 正在检查事务
---> 软件包 fuse3-libs.x86_64.0.3.6.1-4.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

============================================================================================================================================
 Package                                 架构                 版本                                     源                              大小
============================================================================================================================================
正在安装:
 containerd.io                           x86_64               1.4.3-3.1.el7                            docker-ce-stable                33 M
 docker-ce                               x86_64               3:20.10.0-3.el7                          docker-ce-stable                27 M
 docker-ce-cli                           x86_64               1:20.10.0-3.el7                          docker-ce-stable                33 M
为依赖而安装:
 container-selinux                       noarch               2:2.119.2-1.911c772.el7_8                extras                          40 k
 docker-ce-rootless-extras               x86_64               20.10.0-3.el7                            docker-ce-stable               9.0 M
 fuse-overlayfs                          x86_64               0.7.2-6.el7_8                            extras                          54 k
 fuse3-libs                              x86_64               3.6.1-4.el7                              extras                          82 k
 slirp4netns                             x86_64               0.4.3-4.el7_8                            extras                          81 k

事务概要
============================================================================================================================================
安装  3 软件包 (+5 依赖软件包)

总下载量:102 M
安装大小:420 M
Is this ok [y/d/N]: y
Downloading packages:
(1/8): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm                                                          |  40 kB  00:00:03     
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/docker-ce-20.10.0-3.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
docker-ce-20.10.0-3.el7.x86_64.rpm 的公钥尚未安装
(2/8): docker-ce-20.10.0-3.el7.x86_64.rpm                                                                            |  27 MB  00:01:23     
(3/8): containerd.io-1.4.3-3.1.el7.x86_64.rpm                                                                        |  33 MB  00:01:44     
(4/8): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm                                                                       |  54 kB  00:00:01     
(5/8): slirp4netns-0.4.3-4.el7_8.x86_64.rpm                                                                          |  81 kB  00:00:03     
(6/8): fuse3-libs-3.6.1-4.el7.x86_64.rpm                                                                             |  82 kB  00:00:04     
(7/8): docker-ce-rootless-extras-20.10.0-3.el7.x86_64.rpm                                                            | 9.0 MB  00:00:26     
(8/8): docker-ce-cli-20.10.0-3.el7.x86_64.rpm                                                                        |  33 MB  00:01:16     
--------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                        648 kB/s | 102 MB  00:02:40     
从 https://mirrors.aliyun.com/docker-ce/linux/centos/gpg 检索密钥
导入 GPG key 0x621E9F35:
 用户ID     : "Docker Release (CE rpm) <[email protected]>"
 指纹       : 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
 来自       : https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch                                                                      1/8 
  正在安装    : containerd.io-1.4.3-3.1.el7.x86_64                                                                                      2/8 
  正在安装    : 1:docker-ce-cli-20.10.0-3.el7.x86_64                                                                                    3/8 
  正在安装    : slirp4netns-0.4.3-4.el7_8.x86_64                                                                                        4/8 
  正在安装    : fuse3-libs-3.6.1-4.el7.x86_64                                                                                           5/8 
  正在安装    : fuse-overlayfs-0.7.2-6.el7_8.x86_64                                                                                     6/8 
  正在安装    : docker-ce-rootless-extras-20.10.0-3.el7.x86_64                                                                          7/8 
  正在安装    : 3:docker-ce-20.10.0-3.el7.x86_64                                                                                        8/8 
  验证中      : 3:docker-ce-20.10.0-3.el7.x86_64                                                                                        1/8 
  验证中      : fuse3-libs-3.6.1-4.el7.x86_64                                                                                           2/8 
  验证中      : fuse-overlayfs-0.7.2-6.el7_8.x86_64                                                                                     3/8 
  验证中      : slirp4netns-0.4.3-4.el7_8.x86_64                                                                                        4/8 
  验证中      : docker-ce-rootless-extras-20.10.0-3.el7.x86_64                                                                          5/8 
  验证中      : 1:docker-ce-cli-20.10.0-3.el7.x86_64                                                                                    6/8 
  验证中      : containerd.io-1.4.3-3.1.el7.x86_64                                                                                      7/8 
  验证中      : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch                                                                      8/8 

已安装:
  containerd.io.x86_64 0:1.4.3-3.1.el7           docker-ce.x86_64 3:20.10.0-3.el7           docker-ce-cli.x86_64 1:20.10.0-3.el7          

作为依赖被安装:
  container-selinux.noarch 2:2.119.2-1.911c772.el7_8 docker-ce-rootless-extras.x86_64 0:20.10.0-3.el7 fuse-overlayfs.x86_64 0:0.7.2-6.el7_8
  fuse3-libs.x86_64 0:3.6.1-4.el7                    slirp4netns.x86_64 0:0.4.3-4.el7_8              

完毕!
[root@localhost roo]# 
[root@localhost roo]# 
[root@localhost roo]# 
[root@localhost roo]# 
[root@localhost roo]# 
[root@localhost roo]# system start docker
bash: system: 未找到命令...
[root@localhost roo]# systemctl start docker
[root@localhost roo]# docker --version
Docker version 20.10.0, build 7287ab3
[root@localhost roo]# docker version
Client: Docker Engine - Community
 Version:           20.10.0
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        7287ab3
 Built:             Tue Dec  8 18:57:35 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.0
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       eeddea2
  Built:            Tue Dec  8 18:56:55 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
[root@localhost roo]# docker image

Usage:  docker image COMMAND

Manage images

Commands:
  build       Build an image from a Dockerfile
  history     Show the history of an image
  import      Import the contents from a tarball to create a filesystem image
  inspect     Display detailed information on one or more images
  load        Load an image from a tar archive or STDIN
  ls          List images
  prune       Remove unused images
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rm          Remove one or more images
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

Run 'docker image COMMAND --help' for more information on a command.
[root@localhost roo]# docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
[root@localhost roo]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete 
Digest: sha256:e7c70bb24b462baa86c102610182e3efcb12a04854e8c582838d92970a09f323
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

[root@localhost roo]# docker images
REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
hello-world   latest    bf756fb1ae65   11 months ago   13.3kB
[root@localhost roo]# 
[root@localhost roo]# 
[root@localhost roo]# sudo mkdir -p /etc/docker
[root@localhost roo]# sudo tee /etc/docker/daemon.json <<-'EOF'
> {
    
>   "registry-mirrors": ["https://9xj7kbt8.mirror.aliyuncs.com"]
> }
> EOF
{
    
  "registry-mirrors": ["https://9xj7kbt8.mirror.aliyuncs.com"]
}
[root@localhost roo]# sudo systemctl daemon-reload
[root@localhost roo]# sudo systemctl restart docker
[root@localhost roo]# 
[root@localhost roo]# 
[root@localhost roo]# 
[root@localhost roo]# sudo mkdir -p /etc/docker
[root@localhost roo]# ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        inet6 fe80::42:5dff:fe8c:fc24  prefixlen 64  scopeid 0x20<link>
        ether 02:42:5d:8c:fc:24  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 11  bytes 1483 (1.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.186  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::d28d:6577:32f3:4db8  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:8c:77:e4  txqueuelen 1000  (Ethernet)
        RX packets 586110  bytes 852710431 (813.2 MiB)
        RX errors 0  dropped 23  overruns 0  frame 0
        TX packets 314530  bytes 20889649 (19.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 208  bytes 17760 (17.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 208  bytes 17760 (17.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:90:32:9d  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost roo]# 
[root@localhost roo]# 
[root@localhost roo]# docker version
Client: Docker Engine - Community
 Version:           20.10.0
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        7287ab3
 Built:             Tue Dec  8 18:57:35 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.0
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       eeddea2
  Built:            Tue Dec  8 18:56:55 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
[root@localhost roo]# docker image

Usage:  docker image COMMAND

Manage images

Commands:
  build       Build an image from a Dockerfile
  history     Show the history of an image
  import      Import the contents from a tarball to create a filesystem image
  inspect     Display detailed information on one or more images
  load        Load an image from a tar archive or STDIN
  ls          List images
  prune       Remove unused images
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rm          Remove one or more images
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

Run 'docker image COMMAND --help' for more information on a command.
[root@localhost roo]# docker images
REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
hello-world   latest    bf756fb1ae65   11 months ago   13.3kB
[root@localhost roo]# docker pull composer
Using default tag: latest

latest: Pulling from library/composer
188c0c94c7c5: Pull complete 
45f8bf6cfdbe: Pull complete 
ce5be7974012: Pull complete 
a99dd6507fe5: Pull complete 
11c513a1b503: Pull complete 
ff080eafb4c0: Pull complete 
e818119992b1: Pull complete 
cba3c14a67f9: Pull complete 
fbb0285b7ad2: Pull complete 
0e1df8dc2247: Pull complete 
8b920d7e816e: Pull complete 
0751062e31d2: Pull complete 
dfa78ab21f7e: Pull complete 
51566da670a3: Pull complete 
1b5de5d9a22a: Pull complete 
Digest: sha256:dde179e850cc8bb5817922994f423cc7e66971df90c1e727b68df8f2f2d52333
Status: Downloaded newer image for composer:latest
docker.io/library/composer:latest
[root@localhost roo]# 
[root@localhost roo]# docker images
REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
composer      latest    4eb9c84dfcfe   7 days ago      176MB
hello-world   latest    bf756fb1ae65   11 months ago   13.3kB
[root@localhost roo]# ^C
[root@localhost roo]# 

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_44797182/article/details/110922207

智能推荐

Git使用心得_echo "# oneupyenova" >> readme.md git init git add-程序员宅基地

文章浏览阅读170次。Github使用记录最近对github的一些使用心得清除git工程的git信息rm -rf .git本地创建git项目并push到远程echo "# Readme" >> README.mdgit initgit add README.mdgit commit -m "first commit"git remote add origin [email protected]:addressgit push -u origin masterpush一个已经存在的库git rem_echo "# oneupyenova" >> readme.md git init git add readme.md git commit -m

java代码动态注入与class文件热加载实现_java 运行时 注入新类-程序员宅基地

文章浏览阅读5.8k次,点赞3次,收藏18次。一、java代码动态注入在本文中,我们将研究如何将Java代码动态加载到正在运行的jvm中。 该代码可能是全新的,或者我们可能想更改程序中某些现有代码的功能。(在开始之前,您可能想知道为什么到底有人会这样做。显而易见的示例是规则引擎之类的东西。规则引擎希望为用户提供添加或更改规则的能力,而不必重新启动规则。您可以通过将DSL脚本作为规则注入规则库来执行此操作,这种方法的真正问题在于,必须对DSL脚本进行解释,使其运行起来极其缓慢。然后可以像程序中的任何其他代码一样编译和运行该程序,效率将提高几个数量级。_java 运行时 注入新类

用pip安装pymongo模块报错:Could not find a version that satisfies the requirement pymongo(from version:)-程序员宅基地

文章浏览阅读10w+次,点赞28次,收藏40次。安装VN.PY时,进行到安装pymongo步骤出现错误Could not find a version that satisfies the requirement pymongo(from version:)_could not find a version that satisfies the requirement pymongo (from versio

YV12,I420,YUV420P的区别-程序员宅基地

文章浏览阅读43次。2019独角兽企业重金招聘Python工程师标准>>> ..._yv12和iyuv的区别

ubuntu安装neo4j数据库-直接安装与docker方式_neo4j: line 418: /data/workspace/datafactory/neo4j-程序员宅基地

文章浏览阅读568次。本文介绍了ubuntu下分别使用源安装和docker安装neo4j的方法添加下载源安装wget -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -echo 'deb https://debian.neo4j.org/repo stable/' | sudo tee /etc/apt/sources...._neo4j: line 418: /data/workspace/datafactory/neo4j/neo4j-community-3.4.5/run

正则表达式(一)——验证电话号码_判断电话号码的正则表达式-程序员宅基地

文章浏览阅读3.3w次。正则表达式:注意:1.比如你要验证电话号码是否正确,要求是:以1开头,第2位是3,5,8,总共11位 正则表达式应该书写成 ^[1]+[3,8]+\d{9}$package com.ld.num;import java.util.regex.Matcher;import java.util.regex.Pattern;public class Telephone {..._判断电话号码的正则表达式

随便推点

python一二三【warning模块使用】_import warnings-程序员宅基地

文章浏览阅读1.3w次,点赞2次,收藏10次。warning模块使用目的和exception异常要求用户立刻进行处理不同,warning通常用于提示用户一些错误或者过时的用法。casescrapy源码中用到了继承了Warning类创建了一个提醒对象ScrapyDeprecationWarning,用于提醒过时的用户操作,在新版本可能会直接去除支持。用户感知warningspython参数控制warning输出 ..._import warnings

ssm常用的注解_ssm框架注解-程序员宅基地

文章浏览阅读2.3k次。@RestController此注解有两个目的。首先他是一个类似于@controller和@Service的构造型注解,能够让类被组件扫描功能发现。但是,与REST最相关在于@RestController会告诉Spring,控制器中所有的处理器方法的返回值都要直接写入响应体中,而不是将值放到模型中并传递给一个视图以便于渲染。作为替代方案就是@Controller加上@Response。@RestControllerpublic class Controller { }@ApiVersi_ssm框架注解

opengl菜单出现乱码_opengl文字显示(二) | 学步园-程序员宅基地

文章浏览阅读355次。Windows系统中,可以使用wglUseFontBitmaps函数来批量的产生显示字符用的显示列表。函数有四个参数:第一个参数是HDC,学过WindowsGDI的朋友应该会熟悉这个。如果没有学过,那也没关系,只要知道调用wglGetCurrentDC函数,就可以得到一个HDC了。具体的情况可以看下面的代码。第二个参数表示第一个要产生的字符,因为我们要产生0到127的字符的显示列表,所以这里填0..._c++上运行opengl,glutcreatewindow汉字报错

MySQL 团队开发规范_group by后面的字段最好是索引列-程序员宅基地

文章浏览阅读83次。数据库对象命名规范数据库对象数据库对象是数据库的组成部分,常见的有以下几种:表(Table )、索引(Index)、视图(View)、图表(Diagram)、缺省值(Default)、规则(Rule)、触发器(Trigger)、存储过程(Stored Procedure)、 用户(User)等。命名规范是指数据库对象如数据库(SCHEMA)、表(TABLE)、索引(INDEX)、约束(CONSTRAINTS)等的命名约定。数据库对象全局命名规范1、命名使用具有意义的英文词汇,词汇中间以下划线_group by后面的字段最好是索引列

Java入门到精通——第十五单元 多态(没有十四哦)_多态技能目标-程序员宅基地

文章浏览阅读67次。第十五单元 多态昨日知识点回顾本单元知识点概述本单元教学目标(Ⅰ)重点知识目标(Ⅱ)能力目标本单元知识详讲15.1 多态15.1.1 概念引入★★★15.1.2 多态的定义★★★15.1.3 多态体的体现★★★★15.1.4 多态的好处★★★★★15.1.5 向上转型★★★★★15.1.6 向下转型★★★★★15.1.7 转型的使用场景★★★★★15.1.8 转型的异常★★★15.2 接口多态的综合案例15.2.1 案例分析★★★15.2.2 案例实现★★★本单元知识总结昨日知识点回顾接口的概念?接_多态技能目标

热点!《北京市电子印章推广应用行动方案(试行)》发布_电子印章推广方案-程序员宅基地

文章浏览阅读220次。12月4日,北京市经济和信息化局、市政务服务管理局、市公安局联合印发《北京市电子印章推广应用行动方案(试行)》(以下简称《行动方案》)。《行动方案》提出,以“统一管理、分步实施、政府带动、并行过渡”为原则,以政务服务领域电子印章应用为突破口,推进电子印章在企业提交可信材料、政府全程在线审批等业务场景中的便捷应用,逐步构建“互联网+”环境下政府管理和服务方式;鼓励政府和企业使用存储在云端的电子印章(简称云章),减少纸质材料和实体印章使用,建立程序更便利、资源更集约的政务服务新模式。《行动方.._电子印章推广方案