docker基础镜像

news2024/9/21 0:34:26

一、配置 docker

本地源

[docker-ce-stable]
name=Docker CE Stable
baseurl=http://10.35.186.181/docker-ce-stable/
enabled=1
gpgcheck=0

配置阿里云Docker Yum源

yum install -y yum-utils device-mapper-persistent-data lvm2 git
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

2、安装完成后启动
启动Docker服务:
    #systemctl enable docker
    #systemctl start docker
查看Docker版本
[root@localhost ~]# docker -v
Docker version 27.0.3, build 7d4bcd8

[root@localhost ~]# docker version
Client: Docker Engine - Community
 Version:           27.0.3
 API version:       1.46
 Go version:        go1.21.11
 Git commit:        7d4bcd8
 Built:             Sat Jun 29 00:04:07 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.0.3
  API version:      1.46 (minimum version 1.24)
  Go version:       go1.21.11
  Git commit:       662f78c
  Built:            Sat Jun 29 00:02:31 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.18
  GitCommit:        ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
 runc:
  Version:          1.7.18
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
  

查看docker运行状态
[root@localhost ~]# docker info
Client: Docker Engine - Community
 Version:    27.0.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.15.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.28.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 4
  Running: 0
  Paused: 0
  Stopped: 4
 Images: 2
 Server Version: 27.0.3
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.14.0-427.13.1.el9_4.x86_64
 Operating System: Rocky Linux 9.4 (Blue Onyx)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 1.703GiB
 Name: localhost.localdomain
 ID: bc83f6a9-af90-4cbf-aaad-f9025ff827e2
 Docker Root Dir: /docker-data
 Debug Mode: false
 Username: fucancan987
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Registry Mirrors:
  https://do.nark.eu.org/
  https://dc.j8.work/
  https://pilvpemn.mirror.aliyuncs.com/
  https://docker.m.daocloud.io/
  https://dockerproxy.com/
  https://docker.mirrors.ustc.edu.cn/
  https://docker.nju.edu.cn/
 Live Restore Enabled: false

3、生产 doker 的配置环境(加入多个国内镜像源)

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": [
        "https://do.nark.eu.org",
        "https://dc.j8.work",
        "https://pilvpemn.mirror.aliyuncs.com",
        "https://docker.m.daocloud.io",
        "https://dockerproxy.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.nju.edu.cn"
   ],
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "overlay2"
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
#注意:一定注意编码问题,出现错误---查看命令:journalctl -amu docker 即可发现错误

4、登入登出 docker hub

[root@localhost ~]# docker login
Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to er.com/ to create one.
You can log in with your password or a Personal Access Token (PAT). Using a limited-scope PAT grants better security and is requitions using SSO. Learn more at https://docs.docker.com/go/access-tokens/

Username: fucancan987
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credential-stores

Login Succeeded


[root@localhost ~]# docker logout
Removing login credentials for https://index.docker.io/v1/

5、配置数据存放位置

vim /usr/lib/systemd/system/docker.service
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --data-root=/docker-data #加入此参数可以设定docker的文件目录位置,如果没有需要创建
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutStartSec=0
RestartSec=2
Restart=always

配置保存完毕后需要初始化
systemctl daemon-reload

二、docker 操作 

1、查看当前 docker 镜像

[root@localhost ~]# docker images
REPOSITORY             TAG       IMAGE ID       CREATED       SIZE
fucancan987/practice   nginx     fffffc90d343   3 weeks ago   188MB
nginx                  latest    fffffc90d343   3 weeks ago   188MB
test                   latest    fffffc90d343   3 weeks ago   188MB
rockylinux             latest    210996f98b85   2 years ago   205MB

 2、运行 docker 镜像

直接运行容器,推出后容器就会关闭

[root@localhost ~]# docker run -it rockylinux:latest /bin/bash
[root@5228639101f2 /]# ping www.baidu.com
PING www.a.shifen.com (183.2.172.185) 56(84) bytes of data.
64 bytes from 183.2.172.185 (183.2.172.185): icmp_seq=1 ttl=127 time=42.1 ms
64 bytes from 183.2.172.185 (183.2.172.185): icmp_seq=2 ttl=127 time=74.3 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 42.088/58.207/74.326/16.119 ms
[root@5228639101f2 /]# exit
exit

-d 后台运行容器

[root@localhost ~]# docker run -itd rockylinux:latest /bin/bash
93d642bf9d8d28206ffdf0f8ae3a8febc415d7428b28a89743c5804521327086
[root@localhost ~]# docker container ls
CONTAINER ID   IMAGE               COMMAND       CREATED          STATUS          PORTS     NAMES
93d642bf9d8d   rockylinux:latest   "/bin/bash"   59 seconds ago   Up 58 seconds             sharp_hertz
[root@localhost ~]# docker attach sharp_hertz
[root@93d642bf9d8d /]# exit
exit

[root@localhost ~]# docker ps -a
CONTAINER ID   IMAGE               COMMAND                  CREATED          STATUS                      PORTS     NAMES
b46abdcb5d30   rockylinux:latest   "/bin/bash"              12 minutes ago   Up 12 minutes                         wizardly_ganguly
[root@localhost ~]# docker exec -it b46abdcb5d30 /bin/bash

3、停止 、删除 docker 镜像 stop rm

[root@localhost docker-data]# docker ps
CONTAINER ID   IMAGE               COMMAND       CREATED          STATUS          PORTS     NAMES
b46abdcb5d30   rockylinux:latest   "/bin/bash"   42 minutes ago   Up 42 minutes             wizardly_ganguly
[root@localhost docker-data]# docker stop b46abdcb5d30
b46abdcb5d30
[root@localhost docker-data]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

[root@localhost docker-data]# docker ps -a
CONTAINER ID   IMAGE               COMMAND                  CREATED          STATUS                      PORTS     NAMES
b46abdcb5d30   rockylinux:latest   "/bin/bash"              43 minutes ago   Exited (0) 13 seconds ago             wizardly_ganguly
93d642bf9d8d   rockylinux:latest   "/bin/bash"              47 minutes ago   Exited (0) 43 minutes ago             sharp_hertz
5228639101f2   rockylinux:latest   "/bin/bash"              48 minutes ago   Exited (0) 47 minutes ago             agitated_wu
f888743a2d22   rockylinux          "/bin/bash"              5 hours ago      Exited (127) 5 hours ago              admiring_goldstine
2ea9b1b927ad   nginx               "/docker-entrypoint.…"   5 hours ago      Exited (0) 5 hours ago                some-nginx
04c1365e723c   nginx:latest        "/docker-entrypoint.…"   5 hours ago      Exited (127) 5 hours ago              confident_lamarr
a3cc60263ed6   nginx:latest        "/docker-entrypoint.…"   5 hours ago      Exited (0) 5 hours ago                cranky_lamport
[root@localhost docker-data]# docker rm b46abdcb5d30
b46abdcb5d30
[root@localhost docker-data]# docker ps -a
CONTAINER ID   IMAGE               COMMAND                  CREATED          STATUS                      PORTS     NAMES
93d642bf9d8d   rockylinux:latest   "/bin/bash"              47 minutes ago   Exited (0) 44 minutes ago             sharp_hertz
5228639101f2   rockylinux:latest   "/bin/bash"              48 minutes ago   Exited (0) 48 minutes ago             agitated_wu
f888743a2d22   rockylinux          "/bin/bash"              5 hours ago      Exited (127) 5 hours ago              admiring_goldstine
2ea9b1b927ad   nginx               "/docker-entrypoint.…"   5 hours ago      Exited (0) 5 hours ago                some-nginx
04c1365e723c   nginx:latest        "/docker-entrypoint.…"   5 hours ago      Exited (127) 5 hours ago              confident_lamarr
a3cc60263ed6   nginx:latest        "/docker-entrypoint.…"   5 hours ago      Exited (0) 5 hours ago                cranky_lamport
[root@localhost docker-data]#

3、将 docker 镜像打包到本地 docker save

[root@localhost ~]# docker save rockylinux:latest > rockylinux_93.tar.gz
[root@localhost ~]# ls
 rockylinux_93.tar.gz 

4 、导入本地 docker 包 

[root@localhost ~]# docker load -i rockylinux_93.tar.gz
65dbea0a4b39: Loading layer [==================================================>]  211.3MB/211.3MB
Loaded image: rockylinux:latest
[root@localhost ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
rockylinux   latest    210996f98b85   2 years ago   205MB

 三、上传镜像

1、dockerhub 创建账户,创建一个镜像仓库

1.1 创建 tag 名

docker tag REPOSITORY:TAG your REPOSITORY:new tag

打一个 tag,告诉是你自己创建的镜像空间下的

[root@localhost docker-data]# docker tag rockylinux:9.3 fucancan987/practice:9.3
[root@localhost docker-data]# docker login
Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com/ to create one.
You can log in with your password or a Personal Access Token (PAT). Using a limited-scope PAT grants better security and is required for organizations using SSO. Learn more at https://docs.docker.com/go/access-tokens/

Username: fucancan987
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credential-stores

Login Succeeded
[root@localhost docker-data]# docker images
REPOSITORY             TAG       IMAGE ID       CREATED       SIZE
mysql                  8.4       da8f2a99cf39   2 weeks ago   583MB
practice               9.3       da8f2a99cf39   2 weeks ago   583MB
fucancan987/practice   nginx     fffffc90d343   3 weeks ago   188MB
nginx                  latest    fffffc90d343   3 weeks ago   188MB
test                   latest    fffffc90d343   3 weeks ago   188MB
rockylinux             latest    210996f98b85   2 years ago   205MB

推送到自己的镜像仓库 

[root@localhost docker-data]# docker push practice:9.3
The push refers to repository [docker.io/library/practice]
44343de3ea1d: Preparing
denied: requested access to the resource is denied

第一次默认推送推送失败,因为推送的命名空间是library,lirary是公共的、命名空间,没有推送的权限 

[root@localhost docker-data]# docker push fucancan987/practice:9.3
The push refers to repository [docker.io/fucancan987/practice]
 

docker tag [IMAGE] 镜像仓库名/命名空间/REPOSITORY:【镜像版本号,可自定义】 ##打 tag

docker push 镜像仓库名/命名空间/REPOSITORY:【镜像版本号,可自定义】 ##上传

docker pull REPOSITORY:【镜像版本号,可自定义】 ##拉取

四、镜像管理 

1、查找镜像 docker search image_name 【-f stars=number】

[root@localhost ~]# docker search centos
NAME                                   DESCRIPTION                                     STARS     OFFICIAL
centos                                 DEPRECATED; The official build of CentOS.       7744      [OK]
kasmweb/centos-7-desktop               CentOS 7 desktop for Kasm Workspaces            45
rancher/os-centosconsole                                                               0
bellsoft/liberica-openjdk-centos       Liberica is a 100% open-source Java implemen…   4
bellsoft/liberica-openjre-centos       Liberica is a 100% open-source Java implemen…   3
bitnami/centos-base-buildpack          Centos base compilation image                   0
kasmweb/core-centos-7                  CentOS 7 base image for Kasm Workspaces         6
rancher/vm-centos                                                                      0
dokken/centos-7                        CentOS 7 image for kitchen-dokken               10
spack/centos7                          CentOS 7 with Spack preinstalled                2
dokken/centos-8                        CentOS 8 image for use with Test Kitchen's k…   6
dokken/centos-6                        EOL: CentOS 6 image for kitchen-dokken          0
dokken/centos-stream-8                 EOL: CentOS Stream 8 image for use with Test…   5
ustclug/centos                         Official CentOS Image with USTC Mirror          0
dokken/centos-stream-9                 CentOS Stream 9 image for use with Test Kitc…   10
atlas/centos7-atlasos                  ATLAS CentOS 7 Software Development OS          3
codecentric/springboot-maven3-centos   STI builder image for building and running m…   13
spack/centos6                          CentOS 6 with Spack preinstalled                1
apache/couchdbci-centos                Apache CouchDB CI CentOS                        0
vespaengine/vespa-build-centos7        Docker image for building Vespa on CentOS 7.    0
eclipse/centos_jdk8                    CentOS, JDK8, Maven 3, git, curl, nmap, mc, …   5
corpusops/centos                       centos corpusops baseimage                      0
corpusops/centos-bare                  https://github.com/corpusops/docker-images/     0
cincproject/omnibus-centos             CentOS Omnibus builder                          0
starlingx/stx-centos                   StarlingX is an open source distributed clou…   0
##过滤点赞数大于100的镜像源
[root@localhost ~]# docker search centos -f stars=100
NAME      DESCRIPTION                                 STARS     OFFICIAL
centos    DEPRECATED; The official build of CentOS.   7744      [OK]

2、查看当前服务器镜像

[root@localhost ~]# docker images
REPOSITORY             TAG       IMAGE ID       CREATED        SIZE
mysql                  8.4       da8f2a99cf39   2 weeks ago    583MB
mysqltest              8.4       da8f2a99cf39   2 weeks ago    583MB
mysql                  8.0.38    6c54cbcf775a   2 weeks ago    572MB
fucancan987/practice   nginx     fffffc90d343   3 weeks ago    188MB
nginx                  latest    fffffc90d343   3 weeks ago    188MB
test                   latest    fffffc90d343   3 weeks ago    188MB
fucancan987/practice   9.3       9cc24f05f309   7 months ago   176MB
practice               9.3       9cc24f05f309   7 months ago   176MB
rockylinux             9.3       9cc24f05f309   7 months ago   176MB
rockylinux             latest    210996f98b85   2 years ago    205MB
 

[root@localhost ~]# docker image ls
REPOSITORY             TAG       IMAGE ID       CREATED        SIZE
mysql                  8.4       da8f2a99cf39   2 weeks ago    583MB
mysqltest              8.4       da8f2a99cf39   2 weeks ago    583MB
mysql                  8.0.38    6c54cbcf775a   2 weeks ago    572MB
test                   latest    fffffc90d343   3 weeks ago    188MB
fucancan987/practice   nginx     fffffc90d343   3 weeks ago    188MB
nginx                  latest    fffffc90d343   3 weeks ago    188MB
rockylinux             9.3       9cc24f05f309   7 months ago   176MB
fucancan987/practice   9.3       9cc24f05f309   7 months ago   176MB
practice               9.3       9cc24f05f309   7 months ago   176MB
rockylinux             latest    210996f98b85   2 years ago    205MB

[root@localhost ~]# docker image list
REPOSITORY             TAG       IMAGE ID       CREATED        SIZE
mysql                  8.4       da8f2a99cf39   2 weeks ago    583MB
mysqltest              8.4       da8f2a99cf39   2 weeks ago    583MB
mysql                  8.0.38    6c54cbcf775a   2 weeks ago    572MB
test                   latest    fffffc90d343   3 weeks ago    188MB
fucancan987/practice   nginx     fffffc90d343   3 weeks ago    188MB
nginx                  latest    fffffc90d343   3 weeks ago    188MB
fucancan987/practice   9.3       9cc24f05f309   7 months ago   176MB
practice               9.3       9cc24f05f309   7 months ago   176MB
rockylinux             9.3       9cc24f05f309   7 months ago   176MB
rockylinux             latest    210996f98b85   2 years ago    205MB

3、拉取镜像信息 docker pull image_name:tagname

4、查看镜像详细信息 docker inspect image_name:tagname

5、删除镜像 docker rmi REPOSITORY:tagnam

 有容器还在使用镜像会出现无法删除,此时需要强制删除镜像,删除过后,镜像释放自动清空
docker rmi -f REPOSITORY:tagname

6、删除所有镜像 docker rmi $(docker images -q) 

显示所有的镜像id
[root@localhost ~]# docker images -q
da8f2a99cf39
da8f2a99cf39
6c54cbcf775a
fffffc90d343
fffffc90d343
fffffc90d343
9cc24f05f309
9cc24f05f309
9cc24f05f309
210996f98b85

7、修改 tag docker tag image_id REPOSITORY:TAG

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1943817.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

简单修改,让UE4/5着色器编译速度变快

简单修改&#xff0c;让UE4/5着色器编译速度变快 目录 简单修改&#xff0c;让UE4/5着色器编译速度变快 一、问题描述 二、解决方法 &#xff08;一&#xff09;硬件升级 &#xff08;二&#xff09;调整相关设置和提升优先级 1.调整相关设置 &#xff08;1&#xff09…

【Android】碎片的初识

之前我们学习的是一个活动作为一个页面&#xff0c;有了平板之后&#xff0c;页面如果像手机一样设计就会浪费很多的空间&#xff0c;会有很多的空白区域&#xff0c;为了使屏幕充分利用&#xff0c;引入了碎片这样一个概念。 碎片&#xff08;Fragment&#xff09;&#xff1…

pikachu之sql lnjet 字符型注入

先测试一下闭合 注释符号&#xff1a;-- 注释符号可以忽略其后的内容&#xff0c;使得后续的原始查询内容不会影响我们注入的SQL代码。 条件测试&#xff1a;通过and 11和and 12分别测试真假条件&#xff0c;可以判断输入是否成功闭合&#xff0c;并且可以检测注入是否成功。 …

构造+位运算,CF 1901C - Add, Divide and Floor

一、题目 1、题目描述 2、输入输出 2.1输入 2.2输出 3、原题链接 1901C - Add, Divide and Floor 二、解题报告 1、思路分析 我们假设将原数组排序&#xff0c;那么每次操作不会改变数组单调性 当 最大值 调整等于 最小值时 所有数都相等&#xff0c;因为单调性不变&…

VS2022下安装和配置OpenCV环境参数+QT开发环境搭建(1)

1.工具准备 VS2022,OpenCV4.5.5版本&#xff0c;QT5.12.12 VisualStudio最新版直接官网下载&#xff0c;根据需要进行下载&#xff0c;我下载的免费社区版本。日常开发完全够用。 qt官网下载5.12版本。 OpenCVReleases - OpenCV 选择Windows版本下载并解压到本地磁盘&#xff0…

操作系统——笔记(1)

操作系统是管理计算机硬件资源&#xff0c;控制其他程序运行并为用户提供交互操作界面的系统软件的集合&#xff0c;控制和管理着整个计算机系统的硬件和软件资源&#xff0c;是最基本的系统软件。 常见的操作系统&#xff1a;ios、windows、Linux。 计算机系统的结构层次&am…

【SpringCloud】微服务远程调用OpenFeign

工作原理流程图 上代码 common中添加依赖&#xff1a; <dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-openfeign</artifactId> </dependency> <dependency><groupId>org.spri…

Android APP 音视频(01)MediaCodec解码H264码流

说明&#xff1a; 此MediaCodec解码H264实操主要针对Android12.0系统。通过读取sd卡上的H264码流Me获取视频数据&#xff0c;将数据通过mediacodec解码输出到surfaceview上。 1 H264码流和MediaCodec解码简介 1.1 H264码流简介 H.264&#xff0c;也被称为MPEG-4 AVC&#xff…

用51单片机或者stm32能否开发机器人呢?

在开始前刚好我有一些资料&#xff0c;是我根据网友给的问题精心整理了一份「单片机的资料从专业入门到高级教程」&#xff0c; 点个关注在评论区回复“888”之后私信回复“888”&#xff0c;全部无偿共享给大家&#xff01;&#xff01;&#xff01;能的。但是由于单片机和st…

记录安装android studio踩的坑 win7系统

最近在一台新电脑上安装android studio,报了很多错误&#xff0c;也是费了大劲才解决&#xff0c;发出来大家一起避免一些问题&#xff0c;找到解决方法。 安装时一定要先安装jdk&#xff0c;cmd命令行用java -version查当前的版本&#xff0c;没有的话&#xff0c;先安装jdk,g…

ARP欺骗——华为ensp

首先&#xff0c;搭建好网络拓扑。网络设备包含客户端Client1和服务端Server1&#xff0c;交换机 以及 云。 图中的 Client和Server 配置IP地址&#xff0c;要和 vm8 在相同的网段。故设置客户端ip为192.168.11.10 &#xff0c;服务端ip为&#xff1a;192.168.11.20&#xff0…

MySQL补充性文件

数据库专属单词 authentication #身份验证 delimiter #分隔符 character #字符集 collate #整理。 指定字符集的排序规则 unicode #统一码 flush #刷新 privileges #特权 string #串 set #设置 use #使用 zerofill #修饰符。0可以填补输出的值 unsigned #修饰符。无符…

STM32--HAL库--定时器篇

一&#xff1a;如何配置定时器 打开对应工程串口配置好的工程&#xff08;上一篇博客&#xff09;做如下配置&#xff1a; 定时器的中断溢出时间计算公式是&#xff1a; 由图得T100*1000/100MHz 注&#xff1a;100MHz100000000 所以溢出时间等于1ms 关于上图4的自动重装…

Robot Operating System——初探动态配置Parameters

大纲 同步模式Node内使用declare_parameter方法声明Parameters创建Parameter同步访问客户端跨Node修改Parameters跨Node查询Parameters完整代码运行结果 异步模式创建Node&#xff0c;设置Parameters创建Parameter异步访问客户端异步设置&#xff0c;同步等待异步查询&#xff…

VMware三种网络模式---巨细

文章目录 目录 ‘一.网络模式概述 二.桥接模式 二.NAT模式 三.仅主机模式 四.案例演示 防火墙配置&#xff1a; 虚拟电脑配置 前言 本文主要介绍VMware的三种网络模式 ‘一.网络模式概述 VMware中分为三种网络模式&#xff1a; 桥接模式&#xff1a;默认与宿主机VMnet0绑…

CSP-J模拟赛day1——解析+答案

题目传送门 yjq的吉祥数 题解 送分题&#xff0c;暴力枚举即可 Code #include<bits/stdc.h> using namespace std;int l,r; int num1,tmp0,q[10000],a[10000]; int k (int x){for (int j1;j<tmp;j){if (xq[j])return 0;}return 1; } int main(){while (num<100…

php连接sql server

php连接sqlserver有三种方式 一&#xff1a;odbc连接&#xff0c;废话不多说直接上代码,封装了一个单例 <?php /*** odbcServer.php* Author: Erekys*/namespace App\Model; class odbcServer{public static $server;public static $username;public static $password;pu…

dora-rs学习之Rust 和机器人

最近在研究一个网红机器人框架 dora-rs&#xff0c;也看到一些具身智能相关&#xff0c;做机器人遥操作与数据采集及可视化系统的公司使用rust来开发&#xff0c;这里探讨一下dora-rs和rust给机器人带来什么&#xff0c;引述官方的描述&#xff1a;Hello from dora-rs | dora-r…

svelte - 5. 动画

svelte/motion模块导出两个函数&#xff1a; tweened 和 spring。 用于创建writable&#xff08;可写&#xff09;store&#xff0c;其值会在set 和 update之后更新&#xff0c;而不是立即更新。 &#xff08;人话&#xff1a;用 svelte 提供的tweened 和 spring可以达成流程变…

数学建模学习(1)遗传算法

一、简介 遗传算法&#xff08;Genetic Algorithm, GA&#xff09;是一种用于解决优化和搜索问题的进化算法。它基于自然选择和遗传学原理&#xff0c;通过模拟生物进化过程来寻找最优解。 以下是遗传算法的主要步骤和概念&#xff1a; 初始化种群&#xff08;Initialization&a…