Code Monkey home page Code Monkey logo

ipdr's Introduction


logo


IPDR: InterPlanetary Docker Registry

IPFS-backed Docker Registry

License CircleCI Go Report Card GoDoc stability-experimental PRs Welcome

IPDR is a Docker Registry tool that proxies Docker registry requests to IPFS for pushing and pulling images. IPDR allows you to store Docker images on IPFS instead of a central registry like Docker Hub or Google Container Registry. Docker images are referenced by their IPFS hash instead of the repo tag names.

IPDR is compatabile with the Docker Registry HTTP API V2 Spec for pulling images*

*not fully 1:1 implemented yet

High-level overview:

logo

Contents

Install

  • Install with Go:

    go get -u github.com/ipdr/ipdr/cmd/ipdr
  • Install from release binaries:

    # replace x.x.x with the latest version
    wget https://github.com/ipdr/ipdr/releases/download/x.x.x/ipdr_x.x.x_linux_amd64.tar.gz
    tar -xvzf ipdr_x.x.x_linux_amd64.tar.gz ipdr
    ./ipdr --help
    
    # move to bin path
    sudo mv ipdr /usr/local/bin/ipdr

Getting started

Prerequisites

  • Start IPFS daemon (Install instructions):

    $ ipfs daemon
    Initializing daemon...
    Swarm listening on /ip4/127.0.0.1/tcp/4001
    Swarm listening on /ip4/192.168.86.90/tcp/4001
    Swarm listening on /ip6/::1/tcp/4001
    Swarm listening on /p2p-circuit/ipfs/QmR29wrbNv3WrMuodwuLiDwvskuZKKeTtcYDw7SwNffzCH
    Swarm announcing /ip4/127.0.0.1/tcp/4001
    Swarm announcing /ip4/192.168.0.21/tcp/43042
    Swarm announcing /ip4/192.168.86.90/tcp/4001
    Swarm announcing /ip6/::1/tcp/4001
    API server listening on /ip4/0.0.0.0/tcp/5001
    Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080
    Daemon is ready
  • Add 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
    • Flush local DNS cache:

      • on macOS:

        dscacheutil -flushcache; sudo killall -HUP mDNSResponder
      • on Ubuntu 18+:

        sudo systemd-resolve --flush-caches

Example flow

  • Create Dockerfile:

    FROM busybox:latest
    
    CMD echo 'hello world'
  • Build Docker image:

    docker build -t example/helloworld .

    Test run:

    $ docker run example/helloworld:latest
    hello world
  • Use IPDR CLI to push to IPFS:

    $ ipdr push example/helloworld
    
    INFO[0000] [registry] temp: /var/folders/k1/m2rmftgd48q97pj0xf9csdb00000gn/T/205139235
    INFO[0000] [registry] preparing image in: /var/folders/k1/m2rmftgd48q97pj0xf9csdb00000gn/T/657143846
    INFO[0000]
    [registry] dist: /var/folders/k1/m2rmftgd48q97pj0xf9csdb00000gn/T/657143846/default/blobs/sha256:305510b2c684403553fd8f383e8d109b147df2cfde60e40a85564532c383c8b8
    INFO[0000] [registry] compressing layer: /var/folders/k1/m2rmftgd48q97pj0xf9csdb00000gn/T/205139235/886f4bdfa483cc176e947c63d069579785c051793a9634f571fded7b9026cd3c/layer.tar
    INFO[0000] [registry] root dir: /var/folders/k1/m2rmftgd48q97pj0xf9csdb00000gn/T/657143846
    INFO[0000] [registry] upload hash QmRxZ5Wffj6b1j8ckJLcr7yFrbHUhBYXsAMbj7Krwu1pp8
    INFO[0000]
    [registry] uploaded to /ipfs/Qmc2ot2NQadXmbvPbsidyjYDvPfPwKZmovzNpfRPKxXUrL
    INFO[0000] [registry] docker image ciqmw4mig2uwaygddjlutoywq43udutvdmuxkcxvetsjp2mjdde27wi
    
    Successfully pushed Docker image to IPFS:
    /ipfs/Qmc2ot2NQadXmbvPbsidyjYDvPfPwKZmovzNpfRPKxXUrL
  • Use IPDR CLI to pull from IPFS:

    $ ipdr pull /ipfs/QmagW4H1uE5rkm8A6iVS8WuiyjcWQzqXRHbM3KuUfzrCup
    
    INFO[0000] [registry/server] port 5000
    INFO[0000] [registry] attempting to pull docker.local:5000/ciqmw4mig2uwaygddjlutoywq43udutvdmuxkcxvetsjp2mjdde27wi
    INFO[0000] [registry/server] /v2/
    INFO[0000] [registry/server] /v2/ciqmw4mig2uwaygddjlutoywq43udutvdmuxkcxvetsjp2mjdde27wi/manifests/latest
    INFO[0000] [registry/server] location http://127.0.0.1:8080/ipfs/Qmc2ot2NQadXmbvPbsidyjYDvPfPwKZmovzNpfRPKxXUrL/manifests/latest-v2
    {"status":"Pulling from ciqmw4mig2uwaygddjlutoywq43udutvdmuxkcxvetsjp2mjdde27wi","id":"latest"}
    {"status":"Digest: sha256:1fb36e4704d6ebad5becdcfe996807de5f8db687da396330f112157c888c165b"}
    {"status":"Status: Downloaded newer image for docker.local:5000/ciqmw4mig2uwaygddjlutoywq43udutvdmuxkcxvetsjp2mjdde27wi:latest"}
    
    Successfully pulled Docker image from IPFS:
    docker.local:5000/ciqmw4mig2uwaygddjlutoywq43udutvdmuxkcxvetsjp2mjdde27wi
  • Run image pulled from IPFS:

    $ docker run docker.local:5000/ciqmw4mig2uwaygddjlutoywq43udutvdmuxkcxvetsjp2mjdde27wi
    hello world
  • Retag Docker image:

    $ docker tag docker.local:5000/ciqmw4mig2uwaygddjlutoywq43udutvdmuxkcxvetsjp2mjdde27wi example/helloworld:latest
  • We can also pull the image using docker pull:

    • First run the IPDR server in a seperate terminal:

      $ ipdr server -p 5000
      INFO[0000] [registry/server] listening on [::]:5000
    • Then convert the IPFS hash to a valid format docker allows:

      $ ipdr convert QmYMg6WAuvF5i5yFmjT8KkqewZ5Ngh4U9Mp1bGfdjraFVk --format=docker
      
      ciqjjwaeoszdgcaasxmlhjuqnhbctgwijqz64w564lrzeyjezcvbj4y
    • Now we can docker pull the image from IPFS:

      $ docker pull docker.local:5000/ciqjjwaeoszdgcaasxmlhjuqnhbctgwijqz64w564lrzeyjezcvbj4y
      Using default tag: latest
      latest: Pulling from ciqjjwaeoszdgcaasxmlhjuqnhbctgwijqz64w564lrzeyjezcvbj4y
      Digest: sha256:6b787c9e04c2038d4b3cb0392417abdddfcfd88e10005d970fc751cdcfd6d895
      Status: Downloaded newer image for docker.local:5000/ciqjjwaeoszdgcaasxmlhjuqnhbctgwijqz64w564lrzeyjezcvbj4y:latest

      Test run:

      $ docker run docker.local:5000/ciqjjwaeoszdgcaasxmlhjuqnhbctgwijqz64w564lrzeyjezcvbj4y
      hello world

TLDR; example

# build Docker image
docker build -t example/helloworld .

# push to IPFS
IPFS_HASH="$(ipdr push example/helloworld --silent)"

# pull from IPFS
REPO_TAG=$(ipdr pull "$IPFS_HASH" --silent)

# run image pulled from IPFS
docker run "$REPO_TAG"

CLI

$ ipdr --help

The command-line interface for the InterPlanetary Docker Registry.
More info: https://github.com/ipdr/ipdr

Usage:
  ipdr [flags]
  ipdr [command]

Available Commands:
  convert     Convert a hash to IPFS format or Docker registry format
  help        Help about any command
  pull        Pull image from the IPFS-backed Docker registry
  push        Push image to IPFS-backed Docker registry
  server      Start IPFS-backed Docker registry server

Flags:
  -h, --help   help for ipdr

Use "ipdr [command] --help" for more information about a command.

IPNS

An example of using IPNS to resolve image tag names.

  1. First start local server:
ipdr server -p 5000
  1. Tag the image:
docker pull hello-world
docker tag hello-world docker.local:5000/hello-world
  1. Push to local registry:
docker push --quiet docker.local:5000/hello-world

CID mappings live under ~/.ipdr

$ tree ~/.ipdr/
/home/username/.ipdr/
โ””โ”€โ”€ cids
    โ””โ”€โ”€ hello-world
        โ””โ”€โ”€ latest
  1. Add cids directory to IPFS:
$ ipfs add -r ~/.ipdr/cids/ --quieter
QmVtjwa3kdFJHce2wnFuygaCHdSPXraBd4FRSEZKjqZWQp
  1. Set _dnslink TXT record on the domain to point to the directory IPFS hash:
dnslink=/ipfs/QmVtjwa3kdFJHce2wnFuygaCHdSPXraBd4FRSEZKjqZWQp
  1. Verify DNS changes:
$ dig _dnslink.example.com -t TXT +short
"dnslink=/ipfs/QmVtjwa3kdFJHce2wnFuygaCHdSPXraBd4FRSEZKjqZWQp"
  1. Re-run server, now with domain as resolver:
$ ipdr server --cid-resolver=example.com
  1. Now we can run ipdr dig to get CID using repo tag name!
$ ipdr dig hello-world:latest
bafybeiakvswzlopeu573372p5xry47tkc2hhcg5q5rulmbfrnkecrbnt3y

Note: if nothing is returned, then make sure the IPFS gateway is correct.

  1. Next pull and the docker image from IPFS using the resolved CID formatted for docker:
docker pull docker.local:5000/bafybeiakvswzlopeu573372p5xry47tkc2hhcg5q5rulmbfrnkecrbnt3y
docker run docker.local:5000/bafybeiakvswzlopeu573372p5xry47tkc2hhcg5q5rulmbfrnkecrbnt3y

Test

make test

FAQ

  • Q: How do I configure the local registry host or port that IPDR uses when pushing or pulling Docker images?

    • A: Use the --docker-registry-host flag, eg. --docker-registry-host docker.for.mac.local:5000
  • Q: How do I configure the IPFS host that IPDR uses for pushing Docker images?

    • A: Use the --ipfs-host flag, eg. --ipfs-host 127.0.0.1:5001
  • Q: How do I configure the IPFS gateway that IPDR uses for pulling Docker images?

    • A: Use the --ipfs-gateway flag, eg. --ipfs-gateway https://ipfs.io
  • Q: How can I configure the port for the IPDR registry server?

    • A: Use the --port flag, eg. --port 5000
  • Q: How do I setup HTTPS/TLS on the IPDR registry server?

    • A: Use the --tlsKeyPath and --tlsCertPath flag, eg. --tlsKeyPath path/server.key --tlsCertPath path/server.crt
  • Q: How do I get docker.local to work?

    • A: Make sure to add 127.0.0.1 docker.local to /etc/hosts. Optionally, you may use local.ipdr.io which resolves to 127.0.0.1

Contributing

Pull requests are welcome!

For contributions please create a new branch and submit a pull request for review.

Many thanks to @qiangli and all the contributors that made this package better.

Social

Resources

License

Released under the MIT license.

ยฉ Miguel Mota

ipdr's People

Contributors

duske avatar lanzafame avatar miguelmota avatar qiangli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipdr's Issues

IPDR false pulling image

Hi, two scenarios, 1st always succeeds, 2nd actually false downloading

  1. If local docker environment already has one image with the same image id as the one to download from IPFS, this will succeed, because the downloading process actually will tag the image as from IPFS, like docker.localhost:5000/ciqpszt6znuub2lsjf4svnzewe4xjsrtwxhs57dkhp4j4zy2nm7nvpi
  2. If local docker environment does not have , the image downloading actually has no output (you can check by docker image ls), even if ipdr pull commands output show it successfully done.

wishlist: easy way to pull/push manifestlist (multi-arch) images

If I have an existing manifestlist (multi-arch) image, like the standard "busybox" image, it would be nice if this was easy to "republish" in its full manifestlist-form via ipdr/IPFS.

If I do a naive docker pull busybox, I only get the image relevant for my local platform. Similarly a naive docker pull busybox && ipdr push (or a combined ipdr push --docker-registry-host index.docker.io busybox) only converts one of the images in the manifestlist.

It would be neat if there was a "manifestlist-aware" process that just did the right thing. Since regular docker pull/push is weak in this area too, I suggest just skipping them and providing a one-stop ipdr migrate busybox (or whatever subcommand) that does all the required pulling+pushing in one go.

Any plans to modernize the code?

Hey! I was wondering about using this in a project, but due to #18 and the fact that most of the code in the repository hasn't been updated recently and still uses raw HTTP calls instead of e.g. boxo, I decided to instead try rewriting it with "modern" ipfs/boxo and containers/image - to hopefully avoid having to deal with layers of legacy implementations later on.

However, I'm not convinced that's ideal, and I would love to contribute as many as possible of those improvements upstream.

Hence my question: if I were to work on modernizing this repository to use boxo and on exposing a nicer programmatic API, is there any chance that such a PR would be reviewed and merged? I'd be willing to stick around and fix any subsequent bugs this might cause.
If no, that'd be a pity, because it'd mean I'd need to start (/continue) my own separate fork, while this repository already has a lot of the community-building and code structure groundwork in place.

Error: [docker] error pulling image: invalid reference format

Hi,

I was trying to push and pull an image to/from my private IPFS network following the example in the README.

The push operation seems fine:

 ipdr push example/helloworld

...
(omitted lines)
...
Successfully pushed Docker image to IPFS:
/ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq

However, when pulling using the CID I get the following error:

ipdr pull /ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq

INFO[0000] [registry] attempting to pull docker.local:5000//ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq
ERRO[0000] [registry] error pulling image docker.local:5000//ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq; [docker] error pulling image: invalid reference format
Error: [docker] error pulling image: invalid reference format

From one of the nodes I can download the image using ipfs get:

/ # ipfs get /ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq
Saving file(s) to bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq
 756.95 KiB / 756.95 KiB [======================================================================================================================================================================================================] 100.00% 0s

and the content of it seems to be fine:

/ # ls -lahR bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq/
bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq/:
total 16K
drwxr-xr-x    4 root     root        4.0K Jan  9 17:00 .
drwxr-xr-x    1 root     root        4.0K Jan  9 17:00 ..
drwxr-xr-x    2 root     root        4.0K Jan  9 17:00 blobs
drwxr-xr-x    2 root     root        4.0K Jan  9 17:00 manifests

bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq/blobs:
total 768K
drwxr-xr-x    2 root     root        4.0K Jan  9 17:00 .
drwxr-xr-x    4 root     root        4.0K Jan  9 17:00 ..
-rw-------    1 root     root         802 Jan  9 17:00 sha256:4a4a90a980383766e2fcd1c5bbd49c45e9eac992ee66994f985a3bb22698c3a2
-rw-------    1 root     root      754.7K Jan  9 17:00 sha256:5cc84ad355aaa64f46ea9c7bbcc319a9d808ab15088a27209c9e70ef86e5a2aa

bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq/manifests:
total 16K
drwxr-xr-x    2 root     root        4.0K Jan  9 17:00 .
drwxr-xr-x    4 root     root        4.0K Jan  9 17:00 ..
-rw-------    1 root     root         426 Jan  9 17:00 latest
-rw-------    1 root     root         426 Jan  9 17:00 sha256:e2be89f3eb8e587f3fa93dedb1f1b51d7ad5ca85c3a2657a98d97bb983ae57d9

So, why ipdr fails to pull the image?

ipdr push always fail (Help wanted)

Hi,
I am using the latest ipdr sw, and trying to push the image to ipfs, while not working and pending, here is the output:

API server listening at: 127.0.0.1:12641
time="2020-11-11T15:15:14+08:00" level=info msg="[registry] temp: /tmp/933118882"
time="2020-11-11T15:15:14+08:00" level=info msg="[registry] preparing image in: /tmp/021345433"
time="2020-11-11T15:15:14+08:00" level=info msg="\n[registry] dist: /tmp/021345433/default/blobs/sha256:fe85b92a230037eeda1b552cd0d586ac1c345ee4dd2ba0e3028d837ec7cdae36"
time="2020-11-11T15:15:14+08:00" level=info msg="[registry] compressing layer: /tmp/933118882/3843b7e213befd47012d01d57cd13733844715869205b5edcc4d6d91c399574e/layer.tar"
time="2020-11-11T15:15:14+08:00" level=info msg="[registry] root dir: /tmp/021345433"
time="2020-11-11T15:15:14+08:00" level=info msg="[registry] upload hash QmS7C9TMHPph5uaCNhFVSz2Dw83RYuNsz1p3BC6hvbnBpw"

So, I entered the debug, and found it stops here in register.go file,
firstRef = <-refs
Looks the channel was blocking, could you help checking here what's happening? Thank a lot in advance,

Here are more logs:
xxxxx@xxxxx:~$ ipfs daemon
Initializing daemon...
go-ipfs version: 0.7.0
Repo version: 10
System version: amd64/linux
Golang version: go1.14.4
Swarm is limited to private network of peers with the swarm key
Swarm key fingerprint: 3c677552a00bc73dd84197e7e32a57fe
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/172.17.0.1/tcp/4001
Swarm listening on /ip4/192.168.1.111/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/192.168.1.111/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
WebUI: http://127.0.0.1:5001/webui
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready

ipdr pull: README mistake

Replace

$ ipdr pull /ipfs/QmagW4H1uE5rkm8A6iVS8WuiyjcWQzqXRHbM3KuUfzrCup

With

$ ipdr pull QmagW4H1uE5rkm8A6iVS8WuiyjcWQzqXRHbM3KuUfzrCup

verification failed for digest, after delete local images

hi,I followed the instructions in you example . i pushed image by ipdr push, then i delete the image in local,run the ipdr server to pull the image,and I end up with this issue. do you have any advise about below issue

docker  pull docker.localhost:5000/ciqngshw6whbam2v2l2g4sqicdavn7yjz74hkkyxonud4vmwkq6zwpi
Using default tag: latest
latest: Pulling from ciqngshw6whbam2v2l2g4sqicdavn7yjz74hkkyxonud4vmwkq6zwpi
d56055da3352: Pulling fs layer
b78ec9586b34: Verifying Checksum
c6926fcee191: Downloading  556.8kB
007a7f930352: Verifying Checksum
2f1b41b24201: Waiting
77737de99484: Waiting
7e7fffcdabb3: Waiting
63c0d98a7405: Waiting
ab34501b6513: Waiting
6eee05a7d201: Waiting
889c2b92ac95: Waiting
598024f3bc18: Waiting
filesystem layer verification failed for digest sha256:007a7f930352c0fd98663021fb1ee08768462eb5bc9045342da9e9f73fd79a7f

unable to push|pull an image with the command docker push|pull

Hi, I'm trying to docker push and docker pull a stub image by using this commands:

  1. ./ipfs daemon
  2. ./ipdr server -p 5000 (in another terminal)
  3. docker tag example/helloworld:latest docker.localhost:5000/foo
  4. docker push docker.localhost:5000/foo

The ipfs daemon seems to start correctly:

Initializing daemon...
go-ipfs version: 0.5.0-dev-4a102207a-dirty
Repo version: 7
System version: amd64/linux
Golang version: go1.12.9
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/172.17.0.1/tcp/4001
Swarm listening on /ip4/192.168.1.61/tcp/4001
Swarm listening on /ip6/2a01:e0a:250:66a0:ad6b:18c7:f55b:a5ae/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /ip6/fd30:6afd:a306:1:120:20f:659a:8659/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/172.17.0.1/tcp/4001
Swarm announcing /ip4/192.168.1.61/tcp/4001
Swarm announcing /ip4/91.169.65.154/tcp/36513
Swarm announcing /ip6/2a01:e0a:250:66a0:ad6b:18c7:f55b:a5ae/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
Swarm announcing /ip6/fd30:6afd:a306:1:120:20f:659a:8659/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
WebUI: http://127.0.0.1:5001/webui
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready

docker push is blocking

When I run the command docker push , the execution is blocking, here is the logs:

The push refers to repository [docker.localhost:5000/foo]
6c0ea40aef9d: Preparing 

The logs of IPDR server:

INFO[0000] [registry/server] listening on [::]:5000     
INFO[0002] [registry/server] /v2/                       
INFO[0002] [registry/server] /v2/foo/blobs/sha256:7c9d20b9b6cda1c58bc4f9d6c401386786f584437abbe87e58910f8a9a15386b 
INFO[0002] [registry/server] location http://ipfs.io/ipfs//blobs/sha256:7c9d20b9b6cda1c58bc4f9d6c401386786f584437abbe87e58910f8a9a15386b 

docker pull is blocking

The docker pull on an image pushed with the command ipdr push is blocking on:

$ sudo docker pull docker.localhost:5000/ciqiafz4mpktsgxeqy7fwkp3scbxponp3pc42emsjq7medrozkj34cy 
Using default tag: latest

Seems to be enter in an infinite loop or deadlock ๐Ÿค”
The logs of IPDR server:

INFO[2794] [registry/server] /v2/                       
INFO[2794] [registry/server] /v2/ciqiafz4mpktsgxeqy7fwkp3scbxponp3pc42emsjq7medrozkj34cy/manifests/latest 
INFO[2794] [registry/server] location http://ipfs.io/ipfs/QmWxfSkYz87RqkYLtKsCeUwYMXy4sVj2ddEiUWigZA9Cie/manifests/latest-v2 

=====================

Do you have an idea why the docker push|pull are not working with a IPDR server ? Maybe I'm missed something in the documentation.

cannot install

go install https://github.com/miguelmota/ipdr/cmd/ipdr can't load package: package https:/github.com/miguelmota/ipdr/cmd/ipdr: cannot find package "https:/github.com/miguelmota/ipdr/cmd/ipdr" in any of: /usr/lib/go-1.10/src/https:/github.com/miguelmota/ipdr/cmd/ipdr (from $GOROOT) /home/bender/.go/src/https:/github.com/miguelmota/ipdr/cmd/ipdr (from $GOPATH)

`ipdr push` returns CID v1

Hi,

When pushing a docker image to IPFS with ipdr push I realized that the returned hash is CID v1 (bafy...) instead of v0 (Qm...) In the example below, it outputs:

Successfully pushed Docker image to IPFS:
/ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq

Full output:

DEBUG=true ipdr push example/helloworld
INFO[0000]/home/mota/go/src/github.com/ipdr/ipdr/registry/registry.go:358 github.com/ipdr/ipdr/registry.(*Registry).Debugf() [registry] temp: /var/folders/m7/rwlf69v56fx_8jwrdhzk8gch0000gn/T/874645859
INFO[0000]/home/mota/go/src/github.com/ipdr/ipdr/registry/registry.go:358 github.com/ipdr/ipdr/registry.(*Registry).Debugf() [registry] preparing image in: /var/folders/m7/rwlf69v56fx_8jwrdhzk8gch0000gn/T/2512509125
INFO[0000]/home/mota/go/src/github.com/ipdr/ipdr/registry/registry.go:358 github.com/ipdr/ipdr/registry.(*Registry).Debugf()
[registry] dist: /var/folders/m7/rwlf69v56fx_8jwrdhzk8gch0000gn/T/2512509125/default/blobs/sha256:4a4a90a980383766e2fcd1c5bbd49c45e9eac992ee66994f985a3bb22698c3a2
INFO[0000]/home/mota/go/src/github.com/ipdr/ipdr/registry/registry.go:358 github.com/ipdr/ipdr/registry.(*Registry).Debugf() [registry] compressing layer: /var/folders/m7/rwlf69v56fx_8jwrdhzk8gch0000gn/T/874645859/776ef6f11105bdac8a99436753f4965c69b783218b859b616ac101c2a8571bdc/layer.tar
INFO[0000]/home/mota/go/src/github.com/ipdr/ipdr/registry/registry.go:358 github.com/ipdr/ipdr/registry.(*Registry).Debugf() [registry] root dir: /var/folders/m7/rwlf69v56fx_8jwrdhzk8gch0000gn/T/2512509125
INFO[0000]/home/mota/go/src/github.com/ipdr/ipdr/registry/registry.go:358 github.com/ipdr/ipdr/registry.(*Registry).Debugf() [registry] upload hash bafybeid5atakreuktrgzi23myvrwhwkddav6m2adbplo77qxznhdxua5vi
INFO[0000]/home/mota/go/src/github.com/ipdr/ipdr/registry/registry.go:358 github.com/ipdr/ipdr/registry.(*Registry).Debugf()
[registry] uploaded to /ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq
INFO[0000]/home/mota/go/src/github.com/ipdr/ipdr/registry/registry.go:358 github.com/ipdr/ipdr/registry.(*Registry).Debugf() [registry] docker image bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq

Successfully pushed Docker image to IPFS:
/ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq

Therefore, when trying to pull it, the image is not found by ipdr in IPFS (although is present in IPFS when retrieving it with ipfs get):

DEBUG=TRUE ipdr pull --docker-registry-host 192.168.1.58:5000 --ipfs-gateway=http://192.168.1.58:8080 --ipfs-host 192.168.1.58:5001 ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq
INFO[0000]/home/mota/go/src/github.com/ipdr/ipdr/registry/registry.go:358 github.com/ipdr/ipdr/registry.(*Registry).Debugf() [registry] attempting to pull 192.168.1.58:5000/ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq
ERRO[0000]/home/mota/go/src/github.com/ipdr/ipdr/registry/registry.go:169 github.com/ipdr/ipdr/registry.(*Registry).PullImage() [registry] error pulling image 192.168.1.58:5000/ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq; [docker] error pulling image: Error response from daemon: manifest for 192.168.1.58:5000/ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq:latest not found: manifest unknown: cannot resolve CID: ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq:latest
Error: [docker] error pulling image: Error response from daemon: manifest for 192.168.1.58:5000/ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq:latest not found: manifest unknown: cannot resolve CID: ipfs/bafybeidfrvtj7y77vmncf7tizctiefx45poac2fzxzlfbk663rjbd65qyq:latest

I think that the issue is that the library assumes the CID received will be always of version 0 and tries to decode it in base 58.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.