# 上傳你的映像檔docker push

把前面做好的自己的 Docker Image Push到公開網路的 Docker Hub 上，所有的人都可以把這個 Docker Image Pull 下來使用。

**實作的流程如下：**

1. 註冊 Docker Hub 帳號
2. 把 Docker Image Push 到 Docker Hub 上
3. 測試是否成功的把 Docker Image Push 到 Docker Hub 上

**一. 註冊 Docker Hub 帳號**

**到** [**Docker Hub**](https://hub.docker.com/) **的網站如下圖，註冊一個身份**

<div align="left"><img src="/files/-Lkq2--oxXcjRKPm5DCd" alt=""></div>

**把 Docker Image Push 到 Docker Hub 上，需要把 Docker Image 加上 tag，如下**

```
docker tag kawsing/xoops kawsing/xoops
docker images kawsing/xoops
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
kawsing/xoops       latest              f04859f57535        7 minutes ago       384MB
```

docker login

```
docker login

Authenticating with existing credentials...
WARNING! Your password will be stored unencrypted in /home/pi/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

```

**使用 `docker push` 指令把 Docker Image Push 到 Docker Hub 裡，指令如下**

**docker push kawsing/xoops**

```
docker push kawsing/xoops

The push refers to repository [docker.io/kawsing/xoops]
77a4e7448214: Pushed 
83cda524aaa0: Pushed 
e0e3a619ec02: Pushed 
2bf51f986c65: Pushed 
a50966a58c17: Pushed 
e3bee1286943: Pushed 
1acbac8cffb5: Pushed 
0e48c50eb4c5: Pushed 
373c78bced6a: Pushed 
5c519269a031: Pushed 
8b47914b1b79: Pushed 
7ee305e220ee: Pushed 
35d63a46de5d: Pushed 
e9bfffa411ce: Pushed 
f1bcd730ab31: Pushed 
04ecefb5fdf6: Pushed 
e79142719515: Mounted from library/ubuntu 
aeda103e78c9: Mounted from library/ubuntu 
2558e637fbff: Mounted from library/ubuntu 
f749b9b0fb21: Mounted from library/ubuntu 

```

![](/files/-LkqEsJt3MDekC-e4GA9)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/docker-cong-an-zhuang-dao-ying-yong-ru-men-pian/untitled-5.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
