harbor/docs/user_guide.md

109 lines
4.3 KiB
Markdown
Raw Normal View History

2016-03-07 09:39:36 +00:00
#User Guide
##Overview
This guide takes you through the fundamentals of using Harbor. You'll learn how to use Harbor to:
2016-03-08 03:58:48 +00:00
* Manage your projects
* Manage members of a project
* Search projects and repositories
* Manage Harbor system if you are the system administrator
* Pull and push images using Docker client
2016-03-07 09:39:36 +00:00
##Role Based Access Control
RBAC (Role Based Access Control) is provided in Harbor and there are four roles with different privileges:
* **Guest**: Guest has read-only privilege for a specified project.
* **Developer**: Developer has read and write privileges for a project.
2016-03-08 03:58:48 +00:00
* **ProjectAdmin**: When creating a new project, you will be assigned the "ProjectAdmin" role to the project. Besides read-write privileges, the "ProjectAdmin" also has some management privileges, such as adding and removing members.
2016-03-07 09:39:36 +00:00
* **SysAdmin**: "SysAdmin" has the most privileges. In addition to the privileges mentioned above, "SysAdmin" can also list all projects, set an ordinary user as administrator and delete users. The public project "library" is also owned by the administrator.
2016-03-08 03:58:48 +00:00
##User account operations
Username, Email, full name and password are required to sign up in Harbor. The password mast match the rule: at least 7 characters with 1 lowercase letter, 1 capital letter and 1 numeric character.
"Change Password" and "Forgot Password" are also supported. You can follow the steps to reset your password:
1. Click the link "forgot password" in the sign in page.
2016-03-08 04:01:32 +00:00
2. Input the Email used when you signed up and a Email will be sent to it.
3. Click the link contained in the Email.
2016-03-08 03:58:48 +00:00
4. Input your new password and click "Submit".
2016-03-07 09:39:36 +00:00
##Managing projects
2016-03-08 03:58:48 +00:00
A project in Harbor contains all repositories of an application. RBAC is applied to a project. There are two types of projects in Harbor:
2016-03-07 09:39:36 +00:00
* **Public**: All users have the read privilege to a public project, it's convenient for you to share some repositories with others in this way.
2016-03-08 03:58:48 +00:00
* **Private**: A private project can only been accessed by users with proper privileges.
2016-03-07 09:39:36 +00:00
2016-03-08 03:58:48 +00:00
You can create a project after you signed in. Enable the "Public project" checkbox will make this project public.
2016-03-07 09:39:36 +00:00
![create project](img/create_project.png)
2016-03-08 03:58:48 +00:00
After the project is created, you can browse repositories, users and access logs using the navigation column on the left.
2016-03-07 09:39:36 +00:00
![browse project](img/browse_project.png)
2016-03-08 03:58:48 +00:00
All access logs will be listed by clicking "Logs", you can filter them by username or operations and date which are supported in "Advanced Search".
2016-03-07 09:39:36 +00:00
![browse project](img/project_log.png)
2016-03-08 03:58:48 +00:00
##Managing members of a project
2016-03-07 09:39:36 +00:00
###Adding members
You can add members with different roles to an existing project.
![browse project](img/add_member.png)
###Updating and removing members
2016-03-08 03:58:48 +00:00
You can update or remove a member by clicking the icon on the right.
2016-03-07 09:39:36 +00:00
![browse project](img/remove_update_member.png)
##Searching projects and repositories
2016-03-08 03:58:48 +00:00
Entering a keyword in the search field at the top lists all matching projects and repos. The search result includes public repos and private repos you have access privilege to.
2016-03-07 09:39:36 +00:00
![browse project](img/search.png)
##Administrator options
###Setting administrator and deleting user
Administrator can add "SysAdmin" role to an ordinary user and delete users by clicking the icons.
![browse project](img/set_admin_remove_user.png)
##Pulling and pushing images using Docker client
2016-03-08 03:58:48 +00:00
**NOTE: Harbor only supports Registry V2 API. You need to use Docker client 1.6.0 or higher.**
2016-03-07 09:39:36 +00:00
###Pulling images
2016-03-08 03:58:48 +00:00
If the project that the image belongs to is private, you should sign in first:
2016-03-07 09:39:36 +00:00
```sh
$ docker login 10.117.169.182
```
2016-03-08 03:58:48 +00:00
You can now pull the image:
2016-03-07 09:39:36 +00:00
```sh
$ docker pull 10.117.169.182/library/ubuntu:14.04
```
2016-03-08 03:58:48 +00:00
**Note: Replace "10.117.169.182" with the IP address or domain name of your Harbor node.**
2016-03-07 09:39:36 +00:00
###Pushing images
2016-03-08 03:58:48 +00:00
Before pushing an image, you must create a corresponding project on Harbor web UI.
2016-03-07 09:39:36 +00:00
2016-03-08 03:58:48 +00:00
First, log in from Docker client:
2016-03-07 09:39:36 +00:00
```sh
$ docker login 10.117.169.182
```
2016-03-08 03:58:48 +00:00
Tag the image:
2016-03-07 09:39:36 +00:00
```sh
$ docker tag ubuntu:14.04 10.117.169.182/demo/ubuntu:14.04
```
2016-03-08 03:58:48 +00:00
Push the image:
2016-03-07 09:39:36 +00:00
```sh
$ docker push 10.117.169.182/demo/ubuntu:14.04
```
2016-03-08 03:58:48 +00:00
**Note: Replace "10.117.169.182" with the IP address or domain name of your Harbor node.**