Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add dockerfile for automated builds to dockerhub #165

Merged
merged 9 commits into from Oct 12, 2021
3 changes: 3 additions & 0 deletions .dockerignore
@@ -0,0 +1,3 @@
./tests
./docs
./.github
10 changes: 10 additions & 0 deletions Dockerfile
@@ -0,0 +1,10 @@
FROM ubuntu:20.04
RUN apt-get update && apt-get upgrade --yes && apt-get install git python3.8 python3-pip --yes
COPY . .
RUN python3 ./setup.py install
RUN ape plugins add solidity --yes
RUN ape plugins add vyper --yes
Copy link
Contributor

@antazoey antazoey Sep 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of CLI Dockerfiles I see use ENTRYPOINT so it is like running ape when you run the container, which means if you don't give it commands, it just prints the help and exits... I think you mentioned you looked into this pattern, but just thought I'd say that it is common from what I have seen. How much have we considered this approach?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice it builds uses alpine, uses geth command as the entrypoint, and it builds from source!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't used ENTRYPOINT before however I want to make sure that we can do other CLI stuff other than just running ape console for example ape accounts and ape compile etc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be what ever command the user types in!

They would run the container with the same args that they run ape with. So if they run the container with console as the argument, it would launch a console, etc.

Copy link
Contributor

@antazoey antazoey Sep 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this docker run apeworx/ape console

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be what ever command the user types in!
They would run the container with the same args that they run ape with. So if they run the container with console as the argument, it would launch a console, etc.

yes then the problem here then becomes that they can't do other things if they need to with the cli within that image, right?

RUN ape plugins add infura --yes
RUN ape plugins add etherscan --yes
RUN ape plugins add ens --yes
ENTRYPOINT ["ape"]
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -26,6 +26,10 @@ cd ape
python3 setup.py install
```

### via `docker`

Please visit our [Dockerhub](https://hub.docker.com/repository/docker/apeworx/ape) for more details on using Ape with Docker.

## Quick Usage

Ape is primarily meant to be used as a command line tool. Here are some things you can use ape to do:
Expand Down