Dockerfile.alpine has all scripts from original Dockerfile, use for release builds
This commit is contained in:
@@ -197,12 +197,12 @@ jobs:
|
||||
- setup_remote_docker
|
||||
- run:
|
||||
name: Build Docker artifact - demo
|
||||
command: docker build --pull -t "cosmwasm/wasmd-demo:${CIRCLE_SHA1}" .
|
||||
command: docker build --pull -t "cosmwasm/wasmd:${CIRCLE_SHA1}" . -f Dockerfile.alpine
|
||||
- run:
|
||||
name: Push application Docker image to docker hub
|
||||
command: |
|
||||
if [ "${CIRCLE_BRANCH}" = "master" ]; then
|
||||
docker tag "cosmwasm/wasmd-demo:${CIRCLE_SHA1}" cosmwasm/wasmd-demo:latest
|
||||
docker tag "cosmwasm/wasmd:${CIRCLE_SHA1}" cosmwasm/wasmd:latest
|
||||
docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS"
|
||||
docker push cosmwasm/wasmd-demo:latest
|
||||
docker logout
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# docker build . -t wasm-alpine -f ./Dockerfile.alpine
|
||||
# docker run --rm -it wasm-alpine /bin/sh
|
||||
FROM cosmwasm/go-ext-builder:0.8.1-alpine-combi AS builder
|
||||
FROM cosmwasm/go-ext-builder:0.8.2-alpine AS builder
|
||||
|
||||
RUN apk add git
|
||||
# without this, build with LEDGER_ENABLED=false
|
||||
RUN apk add libusb-dev linux-headers
|
||||
|
||||
ENV GO_COSMWASM="v0.8.2-0.20200610212608-c0f4fd4f6b74"
|
||||
ENV GO_COSMWASM="v0.8.2-0.20200615215318-6f82d95b1cb6"
|
||||
|
||||
# copy all code into /code
|
||||
WORKDIR /code
|
||||
@@ -35,8 +35,21 @@ WORKDIR /code
|
||||
|
||||
RUN BUILD_TAGS=muslc make build
|
||||
|
||||
# TODO: try scratch
|
||||
FROM alpine:3.12
|
||||
|
||||
COPY --from=builder /code/build/wasmd /usr/bin/wasmd
|
||||
CMD ["/usr/bin/wasmd help"]
|
||||
COPY --from=builder /code/build/wasmcli /usr/bin/wasmcli
|
||||
|
||||
COPY docker/* /opt/
|
||||
RUN chmod +x /opt/*.sh
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
# rest server
|
||||
EXPOSE 1317
|
||||
# tendermint p2p
|
||||
EXPOSE 26656
|
||||
# tendermint rpc
|
||||
EXPOSE 26657
|
||||
|
||||
CMD ["/usr/bin/wasmd version"]
|
||||
1
Makefile
1
Makefile
@@ -90,7 +90,6 @@ install: go.sum
|
||||
go install -mod=readonly $(BUILD_FLAGS) ./cmd/wasmd
|
||||
go install -mod=readonly $(BUILD_FLAGS) ./cmd/wasmcli
|
||||
|
||||
|
||||
########################################
|
||||
### Documentation
|
||||
|
||||
|
||||
14
README.md
14
README.md
@@ -65,17 +65,17 @@ docker volume rm -f wasmd_data
|
||||
docker run --rm -it \
|
||||
-e PASSWORD=xxxxxxxxx \
|
||||
--mount type=volume,source=wasmd_data,target=/root \
|
||||
cosmwasm/wasmd-demo:latest ./setup.sh cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6
|
||||
cosmwasm/wasmd:latest ./setup.sh cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6
|
||||
|
||||
# This will start both wasmd and wasmcli rest-server, only wasmcli output is shown on the screen
|
||||
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
|
||||
--mount type=volume,source=wasmd_data,target=/root \
|
||||
cosmwasm/wasmd-demo:latest ./run_all.sh
|
||||
cosmwasm/wasmd:latest ./run_all.sh
|
||||
|
||||
# view wasmd logs in another shell
|
||||
docker run --rm -it \
|
||||
--mount type=volume,source=wasmd_data,target=/root,readonly \
|
||||
cosmwasm/wasmd-demo:latest ./logs.sh
|
||||
cosmwasm/wasmd:latest ./logs.sh
|
||||
```
|
||||
|
||||
### CI
|
||||
@@ -88,7 +88,7 @@ rm -rf ./template && mkdir ./template
|
||||
docker run --rm -it \
|
||||
-e PASSWORD=xxxxxxxxx \
|
||||
--mount type=bind,source=$(pwd)/template,target=/root \
|
||||
cosmwasm/wasmd-demo:latest ./setup.sh cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6
|
||||
cosmwasm/wasmd:latest ./setup.sh cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6
|
||||
|
||||
sudo chown -R $(id -u):$(id -g) ./template
|
||||
|
||||
@@ -99,17 +99,17 @@ docker volume rm -f wasmd_data
|
||||
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
|
||||
--mount type=bind,source=$(pwd)/template,target=/template \
|
||||
--mount type=volume,source=wasmd_data,target=/root \
|
||||
cosmwasm/wasmd-demo:latest ./run_all.sh /template
|
||||
cosmwasm/wasmd:latest ./run_all.sh /template
|
||||
|
||||
# RESTART CHAIN with existing state
|
||||
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
|
||||
--mount type=volume,source=wasmd_data,target=/root \
|
||||
cosmwasm/wasmd-demo:latest ./run_all.sh
|
||||
cosmwasm/wasmd:latest ./run_all.sh
|
||||
|
||||
# view wasmd logs in another shell
|
||||
docker run --rm -it \
|
||||
--mount type=volume,source=wasmd_data,target=/root,readonly \
|
||||
cosmwasm/wasmd-demo:latest ./logs.sh
|
||||
cosmwasm/wasmd:latest ./logs.sh
|
||||
```
|
||||
|
||||
## Contributors
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
tail -f /root/log/wasmd.log
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
#!/bin/sh
|
||||
#set -euo pipefail
|
||||
|
||||
mkdir -p /root/log
|
||||
touch /root/log/wasmd.log
|
||||
./run_wasmd.sh >> /root/log/wasmd.log &
|
||||
./run_wasmd.sh $1 >> /root/log/wasmd.log &
|
||||
|
||||
sleep 4
|
||||
echo Starting Rest Server...
|
||||
|
||||
./run_wasmcli.sh
|
||||
./run_rest_server.sh
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
#!/bin/sh
|
||||
#set -euo pipefail
|
||||
|
||||
wasmcli rest-server --laddr tcp://0.0.0.0:1317 --trust-node --cors
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
if test -n "$1"; then
|
||||
# need -R not -r to copy hidden files
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -o errexit -o nounset -o pipefail
|
||||
#!/bin/sh
|
||||
#set -o errexit -o nounset -o pipefail
|
||||
|
||||
PASSWORD=${PASSWORD:-1234567890}
|
||||
STAKE=${STAKE_TOKEN:-ustake}
|
||||
|
||||
Reference in New Issue
Block a user