Harbor's installation and deployment can be quite complicated, as it requires the official configuration file to generate the docker-compose.yml
. Ensure that Docker and Docker Compose are already set up locally.
Manually visit https://github.com/goharbor/harbor/releases to download the compressed package, then extract it and open the directory.
Generate the configuration file:
cp harbor.yml.tmpl harbor.yml
Next, open harbor.yml
and modify a few key points.
Since Harbor itself starts a number of Docker containers and deploys an Nginx container to expose ports, if you have your own reverse proxy tool, be sure to configure the external_url
attribute, remove the HTTPS-related configurations, and modify the exposed HTTP port.
hostname: harbor.aaa.com
# http related config
http:
port: 180
external_url: https://harbor.aaa.com
If you do not configure the external_url
attribute, some addresses generated by Harbor will use hostname:port
. Configuring external_url
helps ensure that the addresses generated by Harbor are consistent with the access path of the reverse proxy, such as for OpenID redirection and repository image download addresses.
Since Harbor has quite a few dependencies, such as Redis and PostgreSQL, if you are deploying it yourself, you can manually set the external_database
, external_redis
, and other attributes; otherwise, Harbor will automatically create these services.
After modifying the configuration, execute install.sh
to generate the docker-compose.yml
and start the containers.
文章评论