Decentralized Docker Hub Registry allows you to push and pull docker images from IPFS. It provides a native docker integration via a custom docker registry server (v2). It is powered by Textile Hub and Textile Buckets. It also has support for Fleek Space Daemon. Decentralized Docker Hub Registry has support for encryption and team sharing via Textile Hub. Custom cron scripts can be written to periodically backup the buckets containing the Docker images to Filecoin.
-
Install Node (v12.10.0 or above)
-
Add an entry in your hosts file
sudo vi /etc/hosts
Add the following line at the end
127.0.0.1 localhost.docker
-
Update docker daemon to only have one max concurrent upload
By default the Docker daemon will push five layers of an image at a time. However we only support only one max concurrent upload at a time. Hence update max-concurrent-uploads to 1 for your docker daemon.
- Textile Hub
- Textile Hub via Fleek Space Daemon
-
Setup Textile Hub
Select one of the below approaches (Textile Hosted Textile Hub or Self Hosted Textile Hub)
-
Textile Hosted Textile Hub https://docs.textile.io/hub/accounts/
-
Download the Hub CLI binary from the release landing page and install it: https://github.com/textileio/textile/releases/latest
-
On MacOS you will need to confirm that it is okay to run the hub binary before it runs successfully.
-
The next step is to initialize an account. The Hub CLI uses a magic-link signin, so it only requires you to enter and verify a valid email.
hub init
-
Create hub keys
hub keys create
Select API key type as account and Require Signature Authentication as N
Then note down hub key and secret. It will be required for the further steps
-
-
Self Hosted Textile Hub
-
Clone Textile Repo
git clone https://github.com/textileio/textile.git cd textile
-
Ensure that make, docker and docker-compose are installed for your OS
-
Start Textile Bucket containers
make buck-up
-
HUB_KEY and HUB_SECRET env variable will be empty for this case
-
-
-
Clone Decentralized Docker Hub Registry repo
git clone https://github.com/viraja1/decentralized_docker_hub_registry.git cd decentralized_docker_hub_registry/hub
-
Install packages
npm install
-
Add env variables
export BUCKET_ENCRYPTION=true export HUB_KEY= export HUB_SECRET=
For HUB_KEY and HUB_SECRET, use the values from the previous steps.
For self hosted Textile Buckets, an extra env variable is required for host
export HUB_HOST=http://127.0.0.1:3007
-
Start server
node server.js
-
Determine the docker image that you want to push to IPFS and tag it for localhost.docker:3000 repo
docker image tag {image_name}:{tag} localhost.docker:3000/{image_name}:{tag}
-
Push the docker image to IPFS via customer docker registry server
docker push localhost.docker:3000/{image_name}:{tag}
-
Pull the docker image from IPFS via customer docker registry server
docker pull localhost.docker:3000/{image_name}:{tag}
-
Run Fleek Space Daemon
https://docs.fleek.co/space-daemon/getting-started/#installation
-
Clone Decentralized Docker Hub Registry repo
git clone https://github.com/viraja1/decentralized_docker_hub_registry.git cd decentralized_docker_hub_registry/daemon
-
Install packages
npm install
-
Generate Key Pair
node generate_key_pair.js
Note down the generated token and set it as an environment variable
export DAEMON_TOKEN=
-
Start server
node server.js
-
Determine the docker image that you want to push to IPFS and tag it for localhost.docker:3000 repo
docker image tag {image_name}:{tag} localhost.docker:3000/{image_name}:{tag}
-
Push the docker image to IPFS via customer docker registry server
docker push localhost.docker:3000/{image_name}:{tag}
-
Pull the docker image from IPFS via customer docker registry server
docker pull localhost.docker:3000/{image_name}:{tag}