-
Notifications
You must be signed in to change notification settings - Fork 333
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
Make docker setup work for me #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works locally and now independent of $(pwd)
. Thank you.
Making an issue for the comments I left
set -o errexit -o nounset -o pipefail | ||
command -v shellcheck > /dev/null && shellcheck "$0" | ||
|
||
# Choose from https://hub.docker.com/r/cosmwasm/wasmd/tags | ||
REPOSITORY="cosmwasm/wasmd" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I would like to use this everywhere. And yes, I forgot to update here.
One issue that I had is that other code uses --name=$CONTAINER_NAME
, but docker doesn't like /
in name, so I need to split it somehow. That's a different issue, but curious about it. Also it would be nice to pull out these common config into one env
file that the other scripts source
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is now called REPOSITORY
was hardcoded in the IOV Core scripts. Good to have it visible in the top of the file.
I don't think this should be mixed up with CONTAINER_NAME
, which is a local name that might or might not be the last part of REPOSITORY
.
|
||
TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/gaia.XXXXXXXXX") | ||
chmod 777 "$TMP_DIR" | ||
echo "Using temporary dir $TMP_DIR" | ||
WASMD_LOGFILE="$TMP_DIR/wasmd.log" | ||
REST_SERVER_LOGFILE="$TMP_DIR/rest-server.log" | ||
SCRIPT_DIR="$(realpath "$(dirname "$0")")" | ||
CONTAINER_NAME="wasmd" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I wonder if we can make this automatically from above config?
CONTAINER_NAME=$(echo $REPOSITORY | cut -d/ -f2)
seems to work.
Both of the following return wasmd
:
echo wasmd | cut -d/ -f2
echo cosmwasm/wasmd | cut -d/ -f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, possible. I this case I have a slight tendency to avoid indirection.
@@ -2,10 +2,12 @@ | |||
set -o errexit -o nounset -o pipefail | |||
command -v shellcheck > /dev/null && shellcheck "$0" | |||
|
|||
# Choose from https://hub.docker.com/r/tendermint/gaia/tags | |||
VERSION="v2.0.0" | |||
# Choose from https://hub.docker.com/r/cosmwasm/wasmd/tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remove the --user
flag, it runs, but I wonder a bit about the design. I can even make HOME=/root
.
The main issue (besides user account) is mounts. It mounts local .gaiad
and .gaiacli
. It needs to mount .wasmcli
(and not .wasmd
at all.. this is just to run the cli command). Further, I wonder about having the local .gaiacli stored in the filesystem somewhere, whereever you execute the cli. A more modern way to mount a "global" docker volume is like in start:
--mount type=volume,source=wasmcli_data,target=/root/.wasmcli
\
I will make some changes in a new PR. This one is a good improvement with paths already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --user
flag is became best practice because of Linux machines where the docker deamon runs as root. Then all the output files are owned by your local user instead of root in the host.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that. In my PR I use a custom volume to store data, so it is never written to the local filesystem (and causing the issues with root files everywhere)
The helper script
cli.sh
was updated but does not work due to CosmWasm/wasmd#43 (which is not a blocker as far as I can see)