Skip to content

Commit 614dfab

Browse files
authored
chore(scripts): add script to launch docker env for building (#357)
* chore(scripts): add script to launch docker env for building * chore: remove unnecessary mounts * fix(scripts): address PR feedback
1 parent ebb1a13 commit 614dfab

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ This command runs a recent pyth-client docker image that already has the necessa
8484
Therefore, once the container is running, all you have to do is run `cd pyth-client && ./scripts/build.sh`.
8585
Note that updates to the `pyth-client` directory made inside the docker container will be persisted to the host filesystem (which is probably desirable).
8686

87+
Alternatively, you can run `./scripts/start-docker-build-env.sh` && `cd pyth-client && cargo build --release`
88+
8789
### Fuzzing
8890

8991
Build a docker image for running fuzz tests:

scripts/start-docker-build-env.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
set -o errexit -o nounset -o pipefail
3+
command -v shellcheck >/dev/null && shellcheck "$0"
4+
5+
dir=$(pwd)
6+
export PYTH_REPO=${dir}
7+
echo "Mounting PYTH_REPO: ${PYTH_REPO}"
8+
9+
# Use the latest oracle image from https://hub.docker.com/r/pythfoundation/pyth-client/tags?name=oracle
10+
LATEST_VERSION="v2.21.0"
11+
export IMAGE=pythfoundation/pyth-client:oracle-${LATEST_VERSION}
12+
echo "Using image: ${IMAGE}"
13+
14+
docker run -it \
15+
--mount "type=bind,src=${PYTH_REPO},target=/home/pyth/pyth-client" \
16+
--platform linux/amd64 \
17+
$IMAGE \
18+
/bin/bash -l

0 commit comments

Comments
 (0)