Harbor私有仓库

news2024/10/6 10:40:38

Harbor私有仓库

文章目录

  • Harbor私有仓库
    • Harbor简介:
    • Harbor 提供了以下主要功能和特性:
    • 优缺点:
    • 环境说明:
    • 部署harbor
        • 1.永久关闭防火墙和seliux,配置阿里云源,添加映射关系
        • 2.安装docker,开启docker服务并添加加速器
        • 3.进入Docker Compose官网查看安装部署流程
        • 4.进入harbor官网,拉取harbor二进制包
        • 5.复制出一份harbor.yml文件,编辑/usr/local/harbor/下的harbor.yml文件
        • 6.执行install.sh文件
        • 7.将harbor设置为开机自启
        • 8.登录到docker的私有镜像仓库(harbor)
        • 9.拉取一个官方镜像,将官方镜像名称更改后上传到我们的私有仓库
        • 10.测试,以拉取的镜像制作一个容器

Harbor简介:

无论是使用Docker-distribution去自建仓库,还是通过官方镜像跑容器的方式去自建仓库,通过前面的演示我们可以发现其是非常的简陋的,还不如直接使用官方的Docker Hub去管理镜像来得方便,至少官方的Docker Hub能够通过web界面来管理镜像,还能在web界面执行搜索,还能基于Dockerfile利用Webhooks和Automated Builds实现自动构建镜像的功能,用户不需要在本地执行docker build,而是把所有build上下文的文件作为一个仓库推送到github上,让Docker Hub可以从github上去pull这些文件来完成自动构建。

但无论官方的Docker Hub有多强大,它毕竟是在国外,所以速度是最大的瓶颈,我们很多时候是不可能去考虑使用官方的仓库的,但是上面说的两种自建仓库方式又十分简陋,不便管理,所以后来就出现了一个被 CNCF 组织青睐的项目,其名为Harbor。

Harbor 提供了以下主要功能和特性:

  1. 容器镜像存储:Harbor 允许用户存储 Docker 镜像,使其能够轻松地管理和分享容器镜像。
  2. 访问控制:Harbor 支持灵活的访问控制策略,可以定义用户和团队对镜像的访问权限,包括读取和写入权限。这有助于维护镜像的安全性和隐私性。
  3. 复制和同步:Harbor 支持镜像的复制和同步功能,允许用户将镜像从一个 Harbor 实例复制到另一个,以便在多个地理位置或环境之间共享。
  4. 漏洞扫描:Harbor 集成了漏洞扫描工具,可以检查镜像中的漏洞,并提供关于安全问题的报告,有助于确保容器镜像的安全性。
  5. 存储策略:用户可以配置存储策略,包括镜像的保留策略和自动清理机制,以控制存储资源的使用。
  6. 多租户支持:Harbor 支持多租户架构,允许不同团队或项目在同一个 Harbor 实例上创建和管理他们自己的私有镜像仓库。
  7. 活动审计:Harbor 记录了所有对镜像仓库的操作,以提供审计功能,帮助跟踪谁在何时访问和修改了镜像。
  8. LDAP/AD集成:Harbor 支持与LDAP和Active Directory集成,方便组织内部管理用户和团队的访问权限。

优缺点:

优点:

  1. 安全性:Harbor 提供强大的访问控制和漏洞扫描功能,有助于确保镜像的安全性。
  2. 隐私:组织可以轻松创建和管理私有仓库,控制其镜像的访问权限,确保敏感数据不会泄露。
  3. 灵活性:Harbor 可以在多云环境或本地部署,适用于各种部署场景。
  4. 多租户:支持多租户,使不同项目或团队能够在同一实例上管理他们自己的仓库。
  5. 容器镜像管理:提供了丰富的容器镜像管理功能,包括复制、同步、存储策略等。

缺点:

  1. 维护成本:部署和维护 Harbor 需要一定的工作量和资源,尤其是在大规模使用时。
  2. 学习曲线:对于新用户来说,配置和管理 Harbor 可能需要一些学习和时间。
  3. 性能:在处理大量镜像时,性能可能成为一个问题,需要适当的硬件和调优。

环境说明:

主机名称IP地址所需服务充当角色
harbor.com192.168.195.135docker,harbor(需先安装docker)私有镜像仓库
docker192.168.195.136docker客户机

部署harbor

[Docker Compose官方文档]

Harbor官方文档

1.永久关闭防火墙和seliux,配置阿里云源,添加映射关系
在所有主机上操作
//此处用harbor.com主机上演示
[root@harbor ~]# systemctl disable --now firewalld.service 
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@harbor ~]# vim /etc/selinux/config 
[root@harbor ~]# grep '^SELINUX=' /etc/selinux/config
SELINUX=disabled
[root@harbor ~]# reboot  //重启后重新连接

[root@harbor ~]# rm -rf /etc/yum.repos.d/*
[root@harbor ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2495  100  2495    0     0   2720      0 --:--:-- --:--:-- --:--:--  2717
[root@harbor ~]# yum clean all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
12 files removed
[root@harbor ~]# yum makecache 
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
CentOS-8.5.2111 - Base - mirrors.aliyun.com                                           3.0 MB/s | 4.6 MB     00:01    
CentOS-8.5.2111 - Extras - mirrors.aliyun.com                                          33 kB/s |  10 kB     00:00    
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com                                      2.2 MB/s | 8.4 MB     00:03    
Metadata cache created.
[root@harbor ~]# vim /etc/hosts
[root@harbor ~]# cat /etc/hosts 
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.195.135 harbor.com
192.168.195.136 docker
2.安装docker,开启docker服务并添加加速器
在所有主机上操作
//此处在harbor.com主机上演示
[root@harbor ~]# dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
[root@harbor ~]# dnf repolist -v    //查看是否启用
[root@harbor ~]# dnf list docker-ce --showduplicates | sort -r    //查看可安装版本 
[root@harbor ~]# yum -y install docker-ce-24.0.6-1.el8 --allowerasing //安装所需版本
[root@harbor ~]# systemctl enable --now docker.service    //启动docker服务
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
[root@harbor ~]#

添加加速器

阿里云登录页 (aliyun.com)
在这里插入图片描述
在这里插入图片描述

在所有主机上操作
//此处在harbor.com主机上演示
[root@harbor ~]# vim /etc/docker/daemon.json
[root@harbor ~]# cat /etc/docker/daemon.json
{
  "dns": ["114.114.114.114"],
  "registry-mirrors": ["https://d5qafvab.mirror.aliyuncs.com"]
}
[root@harbor ~]# systemctl restart docker.service  //重启docker服务生效
[root@harbor ~]# docker info 
   . . .
 Registry Mirrors:
  https://d5qafvab.mirror.aliyuncs.com/      //出现这串信息则表示添加加速器成功
 Live Restore Enabled: false
 
 [root@harbor ~]#
3.进入Docker Compose官网查看安装部署流程

[Docker Compose官方文档]
在这里插入图片描述

[root@harbor ~]# curl -SL https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:16 --:--:--     0
curl: (52) Empty reply from server
[root@harbor ~]# chmod +x /usr/local/bin/docker-compose   //添加执行权限
[root@harbor ~]# ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose //将其链接到/usr/bin/下面

能够使用docker-compose --help则表示成功
在这里插入图片描述

4.进入harbor官网,拉取harbor二进制包

[Harbor官方文档](Releases · goharbor/harbor (github.com))
在这里插入图片描述
在这里插入图片描述

*下载完成后,将该压缩包传到harbor.com主机中
在这里插入图片描述

[root@harbor ~]# ls
anaconda-ks.cfg  harbor-offline-installer-v2.9.1.tgz

//解压压缩包
[root@harbor harbor]# tar xf harbor.v2.9.1.tar.gz -C /usr/local/
5.复制出一份harbor.yml文件,编辑/usr/local/harbor/下的harbor.yml文件
//修改文件中的hostname,并注释掉有关https的信息
[root@harbor local]# ls
bin  etc  games  harbor  include  lib  lib64  libexec  sbin  share  src
[root@harbor local]# cd harbor/ && ls
common     docker-compose.yml    install.sh  prepare    common.sh  harbor.v2.9.1.tar.gz  harbor.yml.tmpl  LICENSE
[root@harbor harbor]# cp harbor.yml.tmpl harbor.yml
[root@harbor local]# cd harbor/ && ls
common     docker-compose.yml    harbor.yml       install.sh  prepare
common.sh  harbor.v2.9.1.tar.gz  harbor.yml.tmpl  LICENSE

//修改如下配置
[root@harbor harbor]# vim harbor.yml
[root@harbor harbor]# grep '^hostname' harbor.yml
hostname: harbor.com    //改为自己的主机名
[root@harbor harbor]# grep -A6 '^# https related config' harbor.yml
# https related config      //注释掉https的信息
#https:
  # https port for harbor, default is 443
  #port: 443
  # The path of cert and key files for nginx
  #certificate: /your/certificate/path
  #private_key: /your/private/key/path
[root@harbor harbor]# grep -A1 '# The default data volume' harbor.yml
# The default data volume
data_volume: /data     //此处可以修改存放位置,尽量选择空间较大的位置
[root@harbor harbor]# grep -A1 '# insecure The flag to skip verifying registry certificate' harbor.yml
  # insecure The flag to skip verifying registry certificate
  insecure: true    //跳过验证证书
6.执行install.sh文件
[root@harbor harbor]# ./install.sh 

[Step 0]: checking if docker is installed ...

Note: docker version: 24.0.7

[Step 1]: checking docker-compose is installed ...

Note: Docker Compose version v2.21.0

[Step 2]: loading Harbor images ...
Loaded image: goharbor/harbor-jobservice:v2.9.1
Loaded image: goharbor/harbor-registryctl:v2.9.1
Loaded image: goharbor/harbor-core:v2.9.1
Loaded image: goharbor/harbor-log:v2.9.1
Loaded image: goharbor/harbor-db:v2.9.1
Loaded image: goharbor/harbor-exporter:v2.9.1
Loaded image: goharbor/redis-photon:v2.9.1
Loaded image: goharbor/nginx-photon:v2.9.1
Loaded image: goharbor/registry-photon:v2.9.1
Loaded image: goharbor/trivy-adapter-photon:v2.9.1
Loaded image: goharbor/prepare:v2.9.1
Loaded image: goharbor/harbor-portal:v2.9.1


[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /usr/local/harbor
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
Clearing the configuration file: /config/portal/nginx.conf
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/registry/passwd
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/registry/root.crt
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/jobservice/config.yml
Generated configuration file: /config/portal/nginx.conf
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /data/secret/keys/secretkey
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir


Note: stopping existing Harbor instance ...
[+] Running 10/10
 ✔ Container harbor-jobservice  Removed                                                                          0.3s 
 ✔ Container nginx              Removed                                                                          0.3s 
 ✔ Container registryctl        Removed                                                                          0.3s 
 ✔ Container harbor-portal      Removed                                                                          0.2s 
 ✔ Container harbor-core        Removed                                                                          0.2s 
 ✔ Container redis              Removed                                                                          0.2s 
 ✔ Container harbor-db          Removed                                                                          0.2s 
 ✔ Container registry           Removed                                                                          0.2s 
 ✔ Container harbor-log         Removed                                                                         10.1s 
 ✔ Network harbor_harbor        Removed                                                                          0.1s 


[Step 5]: starting Harbor ...
[+] Running 10/10
 ✔ Network harbor_harbor        Created                                                                          0.1s 
 ✔ Container harbor-log         Started                                                                          0.0s 
 ✔ Container harbor-portal      Started                                                                          0.0s 
 ✔ Container harbor-db          Started                                                                          0.0s 
 ✔ Container redis              Started                                                                          0.0s 
 ✔ Container registryctl        Started                                                                          0.0s 
 ✔ Container registry           Started                                                                          0.0s 
 ✔ Container harbor-core        Started                                                                          0.0s 
 ✔ Container nginx              Started                                                                          0.0s 
 ✔ Container harbor-jobservice  Started                                                                          0.0s 
✔ ----Harbor has been installed and started successfully.----
[root@harbor harbor]#

//查看启动的容器
[root@harbor harbor]# docker ps
CONTAINER ID   IMAGE                                COMMAND                  CREATED         STATUS                   PORTS                                   NAMES
350ca8862054   goharbor/harbor-jobservice:v2.9.1    "/harbor/entrypoint.…"   5 minutes ago   Up 5 minutes (healthy)                                           harbor-jobservice
b72bc2f82a68   goharbor/nginx-photon:v2.9.1         "nginx -g 'daemon of…"   5 minutes ago   Up 5 minutes (healthy)   0.0.0.0:80->8080/tcp, :::80->8080/tcp   nginx
44f7ef47465b   goharbor/harbor-core:v2.9.1          "/harbor/entrypoint.…"   5 minutes ago   Up 5 minutes (healthy)                                           harbor-core
1b21077159ba   goharbor/harbor-portal:v2.9.1        "nginx -g 'daemon of…"   5 minutes ago   Up 5 minutes (healthy)                                           harbor-portal
e806f3263cd6   goharbor/registry-photon:v2.9.1      "/home/harbor/entryp…"   5 minutes ago   Up 5 minutes (healthy)                                           registry
e88001619f8b   goharbor/harbor-db:v2.9.1            "/docker-entrypoint.…"   5 minutes ago   Up 5 minutes (healthy)                                           harbor-db
3b0dc2c89b77   goharbor/harbor-registryctl:v2.9.1   "/home/harbor/start.…"   5 minutes ago   Up 5 minutes (healthy)                                           registryctl
dd19f6c1fbfa   goharbor/redis-photon:v2.9.1         "redis-server /etc/r…"   5 minutes ago   Up 5 minutes (healthy)                                           redis
e6ebc7e08482   goharbor/harbor-log:v2.9.1           "/bin/sh -c /usr/loc…"   5 minutes ago   Up 5 minutes (healthy)   127.0.0.1:1514->10514/tcp               harbor-log

//镜像存放位置,镜像都存放在我们指定的/data目录下面
[root@harbor harbor]# ls /data
ca_download  database  job_logs  redis  registry  secret

通过IP访问harbor的web界面

在这里插入图片描述
在这里插入图片描述

使用Harbor的注意事项:

  1. 在客户端上传镜像时一定要记得执行docker login进行用户认证,否则无法直接push
  2. 在客户端使用的时候如果不是用的https则必须要在客户端的/etc/docker/daemon.json配置文件中配置insecure-registries参数
  3. 数据存放路径应在配置文件中配置到一个容量比较充足的共享存储中
  4. Harbor是使用docker-compose命令来管理的,如果需要停止Harbor也应用docker-compose stop来停止,其他参数请–help
7.将harbor设置为开机自启
//由于想要关闭或开启harbor需要进入到有docker-compose.yml文件的目录下执行,所以我们将该命令放到虚拟机启动最后执行的一个文件中去,也就是/etc/rc.local文件中

[root@harbor harbor]# vim /etc/rc.local 
[root@harbor harbor]# head -5 /etc/rc.local
#!/bin/bash
cd /usr/local/harbor/ && docker-compose start
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
[root@harbor harbor]# ll /etc/rc.local
lrwxrwxrwx. 1 root root 13 Mar 24  2020 /etc/rc.local -> rc.d/rc.local
[root@harbor harbor]# chmod +x /etc/rc.d/rc.local
[root@harbor harbor]# ll /etc/rc.d/rc.local 
-rwxr-xr-x. 1 root root 520 Nov  7 22:29 /etc/rc.d/rc.local

//将cd /usr/local/harbor/ && docker-compose start写入到这个文件中后,他就会在开启这个虚拟机的时候执行进入/usr/local/harbor/目录中执行开启harbor的命令
8.登录到docker的私有镜像仓库(harbor)
//在登录我们的harbor私有仓库时,需在/etc/docker/daemon.json文件中添加harbor仓库的信息,指定我们设置的harbor.com这个主机名
[root@docker local]# vim /etc/docker/daemon.json 
[root@docker local]# cat /etc/docker/daemon.json
{
  "dns": ["114.114.114.114"],
  "insecure-registries": ["harbor.com"],   //添加此行 
  "registry-mirrors": ["https://d5qafvab.mirror.aliyuncs.com"]
}
[root@docker local]# systemctl restart docker.service    //重启生效

[root@docker ~]# docker login harbor.com   //登录到私有镜像仓库
Username: admin
Password:                    //此处密文密码为Harbor.com
Authenticating with existing credentials...
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/#credentials-store

Login Succeeded   //登录成功
[root@docker ~]#
9.拉取一个官方镜像,将官方镜像名称更改后上传到我们的私有仓库
[root@docker ~]# docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
a2abf6c4d29d: Pull complete 
a9edb18cadd1: Pull complete 
589b7251471a: Pull complete 
186b1aaa4aa6: Pull complete 
b4df32aa5a72: Pull complete 
a0bcbecc962e: Pull complete 
Digest: sha256:0d17b565c37bcbd895e9d92315a05c1c3c9a29f762b011a10c54a66cd53c9b31
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest
[root@docker ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
nginx        latest    605c77e624dd   22 months ago   141MB
[root@docker ~]# docker tag nginx:latest harbor.com/library/nginx:v0.1  //更改名称
[root@docker ~]# docker images
REPOSITORY                 TAG       IMAGE ID       CREATED         SIZE
nginx                      latest    605c77e624dd   22 months ago   141MB
harbor.com/library/nginx   v0.1      605c77e624dd   22 months ago   141MB
[root@docker ~]# docker push harbor.com/library/nginx:v0.1  //上传到私有仓库
The push refers to repository [harbor.com/library/nginx]
d874fd2bc83b: Pushed 
32ce5f6a5106: Pushed 
f1db227348d0: Pushed 
b8d6e692a25e: Pushed 
e379e8aedd4d: Pushed 
2edcec3590a4: Pushed 
v0.1: digest: sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3 size: 1570
[root@docker ~]#

进入私有仓库查看
在这里插入图片描述
在这里插入图片描述

删除现存镜像,尝试从私有仓库拉取镜像

[root@docker ~]# docker rmi -f $(docker images -q)
Untagged: nginx:latest
Untagged: nginx@sha256:0d17b565c37bcbd895e9d92315a05c1c3c9a29f762b011a10c54a66cd53c9b31
Untagged: harbor.com/library/nginx:v0.1
Untagged: harbor.com/library/nginx@sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3
Deleted: sha256:605c77e624ddb75e6110f997c58876baa13f8754486b461117934b24a9dc3a85
Deleted: sha256:b625d8e29573fa369e799ca7c5df8b7a902126d2b7cbeb390af59e4b9e1210c5
Deleted: sha256:7850d382fb05e393e211067c5ca0aada2111fcbe550a90fed04d1c634bd31a14
Deleted: sha256:02b80ac2055edd757a996c3d554e6a8906fd3521e14d1227440afd5163a5f1c4
Deleted: sha256:b92aa5824592ecb46e6d169f8e694a99150ccef01a2aabea7b9c02356cdabe7c
Deleted: sha256:780238f18c540007376dd5e904f583896a69fe620876cabc06977a3af4ba4fb5
Deleted: sha256:2edcec3590a4ec7f40cf0743c15d78fb39d8326bc029073b41ef9727da6c851f
[root@docker ~]# docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
[root@docker ~]# docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
[root@docker ~]# docker pull harbor.com/library/nginx:v0.1
v0.1: Pulling from library/nginx
a2abf6c4d29d: Pull complete 
a9edb18cadd1: Pull complete 
589b7251471a: Pull complete 
186b1aaa4aa6: Pull complete 
b4df32aa5a72: Pull complete 
a0bcbecc962e: Pull complete 
Digest: sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3
Status: Downloaded newer image for harbor.com/library/nginx:v0.1
harbor.com/library/nginx:v0.1

//由于是以图文的方式展示,无法凸显出从私有仓库拉取镜像的效率,但正常情况下从私有仓库拉取镜像比从官方拉取镜像速度快
10.测试,以拉取的镜像制作一个容器
[root@docker ~]# docker run -d -p 80:80 harbor.com/library/nginx:v0.1
ac1593a13a916fe20acf57a14bb5cb67b998d449e5d6b080a98c6dd29099f735
[root@docker ~]# docker ps
CONTAINER ID   IMAGE                           COMMAND                  CREATED         STATUS         PORTS                               NAMES
ac1593a13a91   harbor.com/library/nginx:v0.1   "/docker-entrypoint.…"   2 minutes ago   Up 2 minutes   0.0.0.0:80->80/tcp, :::80->80/tcp   awesome_ellis

在浏览器中通过80端口进行访问
在这里插入图片描述
访问成功

总的来说,Harbor 私有仓库是一个功能丰富、安全可靠的容器镜像管理工具,适用于组织和开发团队,特别是那些需要严格控制镜像访问权限和确保安全性的情况。然而,它需要考虑到部署和维护成本,以及对性能的关注。

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

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

相关文章

西瓜书笔记

周志华老师亲讲-西瓜书全网最详尽讲解-1080p高清原版《机器学习初步》 周志华机器学习(西瓜书)学习笔记(持续更新) 周志华《Machine Learning》学习笔记 绪论 基本术语 数据集(data set):一堆…

常见React Hooks 钩子函数用法

一、useState useState()用于为函数组件引入状态(state)。纯函数不能有状态,所以把状态放在钩子里面。 import React, { useState } from react import ./Button.cssexport function UseStateWithoutFunc() {const [name, setName] useStat…

RK3588平台开发系列讲解(显示篇)MIPI 屏幕驱动调试

🚀返回专栏总目录 文章目录 一、背光驱动1.1、背光 PWM 节点设置1.2、backlight 节点设置二、屏幕初始化序列发送时序参数设置2.1、设备树下 DSI 节点编写2.2、DSI 的 panel 子节点编写沉淀、分享、成长,让自己和他人都能有所收获!😄 📢 调试 MIPI 屏幕主要有三部分内容…

Qt Creator插件

这里以Qt Creator 4.15.2版本的源码为示例进行分析 源码结构如下,为了追溯其插件加载过程,从main.cpp入手 Qt Creator的插件目录,生成的插件,好几十个呢 Qt Creator插件的读取 int main(int argc, char **argv)中以下代码创建插…

jenkins Java heap space

jenkins Java heap space,是内存不够。 两个解决方案: 一,修改配置文件 windows系统中,找到Jenkins的安装路径, 修改jenkins.xml 将 -Xmx256m 改为 -Xmx1024m 或者更大 重启jenkins服务。 二,jenkins增…

海思SD3403/SS928开发板 开发记录二: 设置网络 telnet连接开发板

1.设置网络 设置桥接网络 并修改虚拟机IP网段 问题1.参照前一篇博客 2.ping 测试 主机 虚拟机 板端 相互通信 3.telnet 登录板端

Ps:自由变换

自由变换 Free Transform是 Photoshop 中最常用的命令之一,可对图层、图层蒙版、选区、选区内容等进行缩放、旋转、斜切、扭曲、透视等各种变换操作。 Ps菜单:编辑/自由变换 Edit/Free Transform 快捷键:Ctrl T 或者,在图层上右键…

【全志H616 使用标准库 完成自制串口库(分文件实现) orangepi zero2(开源)】.md updata: 23/11/07

文章目录 H616 把玩注意:Linux内核版本5.16 及以上,需手动配置i2c-3 uart5驱动配置示例 分文件编译时需将每个文件一同编译 (空格隔开)例: ggc a.c b.c b.h -lpthread -lxxx..; 常用命令查看驱动文件查看内核检测信息/…

2000-2022年上市公司专利申请、创新绩效数据

2000-2022年上市公司专利申请、创新绩效数据 1、时间:2000-2022年 2、指标:年份、股票代码、股票简称、行业名称、行业代码、省份、城市、区县、行政区划代码、城市代码、区县代码、首次上市年份、上市状态、专利申请总量、发明专利申请总量、实用新型…

技术分享 | 使用 cURL 发送请求

cURL 是一个通过 URL 传输数据的,功能强大的命令行工具。cURL 可以与 Chrome Devtool 工具配合使用,把浏览器发送的真实请求还原出来,附带认证信息,脱离浏览器执行,方便开发者重放请求、修改参数调试,编写脚…

OJ项目——使用JWT生成Token

目录 前言 1、项目中需要修改哪些东西? 1.1、引入依赖 1.2、编写JWT工具类 1.3、登陆成功后,把以前的session修改为token 1.4、登录拦截器的修改 1.5、展示前端部分代码 前言 有兴趣的小伙伴,可以先看看这篇文章,如果使用s…

python 之 集合的相关知识

文章目录 1. 创建集合使用花括号 {}使用 set() 函数 2. 集合的特点3. 集合操作添加元素删除元素 4. 集合运算5. 不可变集合总结 在 Python 中,集合(Set)是一种无序且不重复的数据集合。它是由一组唯一元素组成的。下面是关于集合的一些基本知…

6.判断是不是闰年

#include<stdio.h>void fun(int year){if(year%40&&year%100!0||year%4000)printf("%d 是闰年\n",year);elseprintf("%d 不是闰年\n",year);}int main(){int year;scanf("%d",&year);fun(year);return 0;}

java记一次replace替换中文双引号失败的问题

事情的起因是一个Java项目中要调用第三方接口&#xff0c;而且无法远程访问该接口进行调试&#xff0c;只能本地写完功能后现场部署测试。 其中接口文档是这样描述的&#xff1a; 实际第三方接口返回值是带中文双引号的字符串【“1”】或者带有英文双引号的字符串【"1&qu…

Python武器库开发-常用模块之subprocess模块(十九)

常用模块之subprocess模块(十九) subprocess模块介绍 subprocess 模块允许我们启动一个新进程&#xff0c;并连接到它们的输入/输出/错误管道&#xff0c;从而获取返回值。subprocess 它可以用来调用第三方工具&#xff08;例如&#xff1a;exe、另一个python文件、命令行工具…

Bun 1.0.7 版本发布,实现多个 Node.js 兼容改进

导读Bun 是一个集打包工具、转译器和包管理器于一体的 JavaScript 运行时&#xff0c;由 Jarred Sumner 发布了 1.0.7 版本。本次更新实现了对 Node.js 运行时的多项兼容性改进&#xff0c;并修复了近 60 个 bug。 根据发布说明&#xff0c;本版本对 “bun install” 命令进行…

yolov8+多算法多目标追踪+实例分割+目标检测+姿态估计(代码+教程)

多目标追踪实例分割目标检测 YOLO (You Only Look Once) 是一个流行的目标检测算法&#xff0c;它能够在图像中准确地定位和识别多个物体。 本项目是基于 YOLO 算法的目标跟踪系统&#xff0c;它将 YOLO 的目标检测功能与目标跟踪技术相结合&#xff0c;实现了实时的多目标跟…

Linux笔记——Ubuntu子系统从系统盘迁移到非系统盘

Linux笔记——Ubuntu子系统从系统盘迁移到非系统盘 一、子系统迁移1. 关闭linux子系统2. 使用move-wsl进行迁移 二、 虚拟机子系统瘦身 安了子系统还没用几天&#xff0c;C盘提示我没空间了。。。剩余0kb的那种。。。Ubuntu安装的时候默认按C盘了&#xff0c;所以还是移走腾点地…

【神经网络】【GoogleNet】

1、引言 卷积神经网络是当前最热门的技术&#xff0c;我想深入地学习这门技术&#xff0c;从他的发展历史开始&#xff0c;了解神经网络算法的兴衰起伏&#xff1b;同时了解他在发展过程中的**里程碑式算法**&#xff0c;能更好的把握神经网络发展的未来趋势&#xff0c;了解神…

第1天:Python基础语法(一)

** 1、Python简介 ** Python是一种高级、通用的编程语言&#xff0c;由Guido van Rossum于1989年创造。它被设计为易于阅读和理解&#xff0c;具有简洁而清晰的语法&#xff0c;使得初学者和专业开发人员都能够轻松上手。 Python拥有丰富的标准库&#xff0c;提供了广泛的功…