command
Version:
v0.0.0-...-4c89dbd
Opens a new window with list of versions in this module.
Published: Nov 20, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
harbor-proxy
A demo example for setting up a proxy for the Docker registry Harbor.
How to Run
-
Update Domain
Replace the following line in your code:
var domain = "your_harbor_domain";
with your actual domain.
-
Run the Application
Execute the following command in your terminal:
go run main.go
-
Edit /etc/hosts
Now,you need to edit the /etc/hosts
file using vim
and add the following entry:
127.0.0.1 dev.test.com
-
Update Docker Daemon Configuration
Edit the /etc/docker/daemon.json
file with vim and add the following under the insecure-registries option:
{
"ipv6": false,
"insecure-registries" : ["dev.test.com:8099"]
}
Note: Ensure that there is a comma after "ipv6": false.
-
Restart Docker
Don’t forget to restart the Docker service:
systemctl restart docker
-
Tag Your Image
Use the following command to tag your image name format as dev.test.com:8099/****:***
. Replace the parts as necessary:
docker tag d2c94e258dcb dev.test.com:8099/g299_remote/ss_g612/redis:latest
-
Push and Pull Images
Now you can push and pull images through your proxy service to Harbor. Use the following commands:
Push Command:
$ docker push dev.test.com:8099/g299_remote/ss_g612/redis:latest
Expected Output:
The push refers to repository [dev.test.com:8099/g299_remote/ss_g612/redis]
950a085c0a1c: Layer already exists
5f70bf18a086: Layer already exists
e4dbf0bd9d9d: Layer already exists
15ef09f03230: Layer already exists
40710ab1222c: Layer already exists
a64e92ee1239: Pushed
9a978e3d8066: Pushed
8e2ab394fabf: Pushed
latest: digest: sha256:9e0dedfd09654001f77a0d1dbe981717a746ef4d253f5d119c50be28e100337f size: 1986
Pull Command:
$ docker pull dev.test.com:8099/g299_remote/ss_g612/mongo
Expected Output:
Using default tag: latest
latest: Pulling from g299_remote/ss_g612/mongo
32b824d45c61: Pull complete
2ffb4886d703: Pull complete
f36248f814ef: Pull complete
0b39c673fa12: Pull complete
a6208dee2c0e: Pull complete
876eec4ef49d: Pull complete
07ed7efc9402: Pull complete
e5e3b551bf11: Pull complete
Digest: sha256:04c3087ed64ee0a408f09f26c2ef8e6c704b2e2482753661004214c7306ccc68
Status: Downloaded newer image for dev.test.com:8099/g299_remote/ss_g612/mongo:latest
dev.test.com:8099/g299_remote/ss_g612/mongo:latest
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.