ethresearch / sharding-p2p-poc

Proof of Concept of Ethereum Serenity Peer-to-Peer Layer on libp2p PubSub System
40 stars 19 forks source link

resolves #102: modified the name of the image in the build-dev rule #103

Closed jrhea closed 5 years ago

jrhea commented 5 years ago

What is wrong?

I get an 'unable to find image' error when busting a make run-dev:

$ make run-dev
docker run -it --rm -v /Users/jonny/go/src/github.com/ethresearch/sharding-p2p-poc:/go/src/github.com/ethresearch/sharding-p2p-poc ethereum/sharding-p2p:dev sh -c "go build -v -o main ."
Unable to find image 'ethereum/sharding-p2p:dev' locally
docker: Error response from daemon: pull access denied for ethereum/sharding-p2p, repository does not exist or may require 'docker login'.
See 'docker run --help'.
make: *** [run-dev] Error 125

How can it be fixed?

Fix the docker build command in the Makefile:

$ git diff Makefile 
diff --git a/Makefile b/Makefile
index 0e63774..21da292 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ build-prod:
        docker build -f docker/prod.Dockerfile -t ethereum/sharding-p2p:latest .

 build-dev:
-       docker build -f docker/dev.Dockerfile -t ethresearch/sharding-p2p:dev .
+       docker build -f docker/dev.Dockerfile -t ethereum/sharding-p2p:dev .

 run-dev:
        docker run -it --rm -v $(PWD):/go/src/github.com/ethresearch/sharding-p2p-poc ethereum/sharding-p2p:dev sh -c "go build -v -o main ."

Cute Animal Picture

put a cute animal picture link inside the parentheses

mhchia commented 5 years ago

cc @ChihChengLiang

ChihChengLiang commented 5 years ago

We use ethresearch/sharding-p2p:dev because we have a docker hub ethresearch repo. Would prefer fixing run-dev to fixing build-dev.

        docker build -f docker/dev.Dockerfile -t ethresearch/sharding-p2p:dev .

 run-dev:
-       docker run -it --rm -v $(PWD):/go/src/github.com/ethresearch/sharding-p2p-poc ethereum/sharding-p2p:dev sh -c "go build -v -o main ."
+       docker run -it --rm -v $(PWD):/go/src/github.com/ethresearch/sharding-p2p-poc ethresearch/sharding-p2p:dev sh -c "go build -v -o main ."

 test-dev: partial-gx-rw
        docker run -it --rm -v $(PWD):/go/src/github.com/ethresearch/sharding-p2p-poc ethereum/sharding-p2p:dev sh -c "go test"
jrhea commented 5 years ago

@mhchia my guess is that you didn't have an error before bc you already have a docker image with that name. Can you do a docker ps -a to see all running and stopped containers. Just a guess

jrhea commented 5 years ago

@ChihChengLiang and @mhchia based on @ChihChengLiang's feedback, I could change the image prefix to ethresearch for build-prod, build-dev, run-dev, and test-dev:

 build-prod:
-       docker build -f docker/prod.Dockerfile -t ethereum/sharding-p2p:latest .
+       docker build -f docker/prod.Dockerfile -t ethresearch/sharding-p2p:latest .

 build-dev:
-       docker build -f docker/dev.Dockerfile -t ethereum/sharding-p2p:dev .
+       docker build -f docker/dev.Dockerfile -t ethresearch/sharding-p2p:dev .

 run-dev:
-       docker run -it --rm -v $(PWD):/go/src/github.com/ethresearch/sharding-p2p-poc ethereum/sharding-p2p:dev sh -c "go build -v -o main ."
+       docker run -it --rm -v $(PWD):/go/src/github.com/ethresearch/sharding-p2p-poc ethresearch/sharding-p2p:dev sh -c "go build -v -o main ."

 test-dev: partial-gx-rw
-       docker run -it --rm -v $(PWD):/go/src/github.com/ethresearch/sharding-p2p-poc ethereum/sharding-p2p:dev sh -c "go test"
+       docker run -it --rm -v $(PWD):/go/src/github.com/ethresearch/sharding-p2p-poc ethresearch/sharding-p2p:dev sh -c "go test"
        gx-go uw

Is that what you what?

ChihChengLiang commented 5 years ago

Thanks @jrhea , that's the desired change ❤️

ChihChengLiang commented 5 years ago

Thanks @jrhea . After merging this, one should run the command to rebuild the docker images. The rebuild would just change the tag for the image, should be fast.