# tar xf harbor-offline-installer-v2.4.1.tgz -C /home
# cd /home # ls harbor [root@harbor-serverhome]# cd harbor/ [root@harbor-serverharbor]# ls common.sh harbor.v2.4.1.tar.gz harbor.yml.tmpl install.sh LICENSE prepare
# mv harbor.yml.tmpl harbor.yml
[root@harbor-serverharbor]# vim harbor.yml [root@harbor-serverharbor]# cat harbor.yml # Configuration file of Harbor
# The IP address or hostname to access admin UI and registry service. # DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients. hostname: 192.168.10.23 修改
# http related config http: # port for http, default is 80. If https enabled, this port will redirect to https port port: 80
# https related config #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-serverharbor]# ./prepare
[root@harbor-serverharbor]# ./install.sh
[root@harbor-serverharbor]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 12605eae32bb goharbor/harbor-jobservice:v2.4.1"/harbor/entrypoint.…" About a minute ago Up About a minute (healthy) harbor-jobservice 85849b46d56d goharbor/nginx-photon:v2.4.1"nginx -g 'daemon of…" About a minute ago Up About a minute (healthy) 0.0.0.0:80->8080/tcp, :::80->8080/tcp nginx 6a18e370354f goharbor/harbor-core:v2.4.1"/harbor/entrypoint.…" About a minute ago Up About a minute (healthy) harbor-core d115229ef49d goharbor/harbor-portal:v2.4.1"nginx -g 'daemon of…" About a minute ago Up About a minute (healthy) harbor-portal f5436556dd32 goharbor/harbor-db:v2.4.1"/docker-entrypoint.…" About a minute ago Up About a minute (healthy) harbor-db 7fb8c4945abe goharbor/harbor-registryctl:v2.4.1"/home/harbor/start.…" About a minute ago Up About a minute (healthy) registryctl d073e5da1399 goharbor/redis-photon:v2.4.1"redis-server /etc/r…" About a minute ago Up About a minute (healthy) redis 7c09362c986b goharbor/registry-photon:v2.4.1"/home/harbor/entryp…" About a minute ago Up About a minute (healthy) registry 55d7f39909e3 goharbor/harbor-log:v2.4.1"/bin/sh -c /usr/loc…" About a minute ago Up About a minute (healthy) 127.0.0.1:1514->10514/tcp harbor-log
[root@jenkins-server ~]# docker login 192.168.10.23 Username: admin 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/#credentials-store
Login Succeeded
4.4.1.2 harbor-server
[root@harbor-serverharbor]# vim /etc/docker/daemon.json [root@harbor-serverharbor]# cat /etc/docker/daemon.json { "insecure-registries": ["http://192.168.10.23"] }
[root@web-server ~]# docker login 192.168.10.23 Username: admin 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/#credentials-store
[root@web-server ~]# mysql -uroot -pabc123 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 5.5.68-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type'help;' or '\h'for help. Type'\c' to clear the current input statement.
MariaDB [(none)]>
MariaDB [(none)]> create database if not exists solo default charset utf8 collate utf8_general_ci;
MariaDB [(none)]> grant all on solo.* to 'root'@'%' identified by "123456"; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> grant all on solo.* to 'root'@'localhost' identified by "123456"; Query OK, 0 rows affected (0.00 sec)
[root@dev ~]# vim solo/src/main/resources/local.properties [root@dev ~]# cat solo/src/main/resources/local.properties # # Solo - A small and beautiful blogging system written in Java. # Copyright (c) 2010-present, b3log.org # # Solo is licensed under Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: # http://license.coscl.org.cn/MulanPSL2 # THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. # See the Mulan PSL v2 for more details. #
# # Description: Solo local environment configurations. # Version: 1.1.3.15, Mar 17, 2019 # Author: Liang Ding #
#### MySQL runtime #### runtimeDatabase=MYSQL jdbc.username=root jdbc.password=123456 jdbc.driver=com.mysql.cj.jdbc.Driver jdbc.URL=jdbc:mysql://192.168.10.24:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
[root@harbor-servertomcatdir]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE 192.168.10.23/library/tomcat 857501c433f8562d About a minute ago 796MB
[root@harbor-servertomcatdir]# docker login 192.168.10.23 Username: admin 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/#credentials-store
[root@harbor-server ~]# docker run -d 192.168.10.23/library/tomcat:8575 d5443961ca65311ca0d68d53d44be997f5d6fde2d78772173ac6927112f34579
[root@harbor-server ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d5443961ca65 192.168.10.23/library/tomcat:8575"/usr/local/tomcat/b…"3 seconds ago Up 2 seconds 8080/tcp nifty_tesla
[root@harbor-server ~]# docker inspect d544
获得:172.17.0.2
[root@harbor-server ~]# curl http://172.17.0.2:8080 tomcat is running