Pinning Docker Images to IPFS
Learn how to pin Docker images to IPFS.
What is IPDR?
IPDR is a Docker Registry tool that publishes Docker images to IPFS, allowing for a decentralized alternative to a central registry like Docker Hub. Once uploaded to IPFS, the docker image must be pinned to persist on IPFS long-term.
Read below to learn how to pin Docker images to IPFS with Filebase.
1. Clone the ipdr
GitHub repository:
ipdr
GitHub repository:wget https://github.com/ipdr/ipdr/releases/download/v0.1.7/ipdr_0.1.7_darwin_arm64.tar.gz
tar -xvzf ipdr_0.1.7_darwin_arm64.tar.gz ipdr
Test the installation with the following command:
./ipdr --help
2. Then, move to the bin path:
sudo mv ipdr /usr/local/bin/ipdr
3. Open a new command prompt and start the IPFS daemon with the following command:
ipfs daemon
4. Then, add docker.local
to /etc/hosts
:
docker.local
to /etc/hosts
:echo '127.0.0.1 docker.local' | sudo tee -a /etc/hosts
echo '::1 docker.local' | sudo tee -a /etc/hosts
5. Create a new file called Dockerfile that contains the following text:
6. Build the Docker image with the command:
docker build -t example/helloworld .
7. Then, run the Docker container to test its functionality:
docker run example/helloworld:latest
If successful, the terminal window will echo ‘hello world
’.
8. Next, use IPDR to push your Docker container to IPFS:
ipdr push example/helloworld
You will receive output resembling the following:
9. Then, navigate to the Filebase web console dashboard. Select the Buckets option from the side bar menu, then select an IPFS bucket or create a new IPFS bucket.
10. Select ‘Upload’ in the upper right corner.
11. Then select ‘CID’:
12. Input the CID returned from the command line and provide a file name to be associated with the CID:
13. Once added, the file will be listed in your bucket:
Last updated