forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create local development Dockerfile and docker-compose (#17)
Adding docker-compose.dev.yml and Dockerfile.dev to mount the current dir and call a script to conditionally build for fast iteration
- Loading branch information
1 parent
47da34c
commit 7cc1988
Showing
5 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Requires the root repo dir to be mounted at /mnt/go-ethereum in order to run this! | ||
FROM golang:1.14-alpine | ||
|
||
RUN apk add --no-cache make gcc musl-dev linux-headers git | ||
RUN apk add --no-cache ca-certificates | ||
|
||
EXPOSE 8545 8546 8547 30303 30303/udp | ||
|
||
# Used to mount the code so image isn't re-built every time code changes | ||
WORKDIR /mnt/go-ethereum | ||
|
||
ENTRYPOINT ["sh", "./docker/dev_entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: "3" | ||
|
||
services: | ||
geth_l2: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
volumes: | ||
- l2-node-data:/mnt/l2-node/l2:rw | ||
- ./:/mnt/go-ethereum/ | ||
|
||
environment: | ||
- REBUILD= # Set this if you want to rebuild on startup, leave unset otherwise | ||
- CLEAR_DATA_KEY | ||
- TARGET_GAS_LIMIT | ||
- VOLUME_PATH=/mnt/l2-node/l2 | ||
- HOSTNAME=geth_l2 | ||
- PORT=8545 | ||
- NETWORK_ID=108 | ||
ports: | ||
- 8545:8545 | ||
|
||
volumes: | ||
l2-node-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
|
||
# Exits if any command fails | ||
set -e | ||
|
||
if [ -n "$REBUILD" ]; then | ||
echo -e "\n\nREBUILD env var set, rebuilding...\n\n" | ||
|
||
make geth | ||
echo -e "\n\nCode built proceeding with ./entrypoint.sh...\n\n" | ||
else | ||
echo -e "\n\nREBUILD env var not set, calling ./entrypoint.sh without building...\n\n" | ||
fi | ||
|
||
echo "Starting Geth..." | ||
## Command to kick off geth | ||
TARGET_GAS_LIMIT=${TARGET_GAS_LIMIT:-4294967295} | ||
./build/bin/geth --dev \ | ||
--datadir $VOLUME_PATH \ | ||
--rpc \ | ||
--rpcaddr $HOSTNAME \ | ||
--rpcvhosts='*' \ | ||
--rpcport $PORT \ | ||
--networkid $NETWORK_ID \ | ||
--rpcapi 'eth,net' \ | ||
--gasprice '0' \ | ||
--targetgaslimit $TARGET_GAS_LIMIT \ | ||
--nousb \ | ||
--gcmode=archive \ | ||
--verbosity "6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.