Updated docker images. (#326)

This commit is contained in:
Ravin Perera
2021-06-23 12:54:39 +05:30
committed by GitHub
parent 6a1fb3c5ad
commit d7733698de
11 changed files with 57 additions and 27 deletions

Binary file not shown.

Binary file not shown.

1
test/docker/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
bin

View File

@@ -0,0 +1,14 @@
# Ubuntu 20.04 + HotPocket
FROM ubuntu:focal
COPY libblake3.so /usr/local/lib/
RUN apt-get update && apt-get install -y \
libssl1.1 \
sqlite3 \
fuse3
RUN mkdir /usr/local/bin/hotpocket
COPY hpcore hpfs hpws appbill /usr/local/bin/hotpocket/
ENTRYPOINT ["/usr/local/bin/hotpocket/hpcore"]

View File

@@ -0,0 +1,7 @@
# HotPocket (Ubuntu 20.04) + NodeJs 14.x
FROM hotpocketdev/hotpocket:ubt.20.04
RUN apt-get install -y curl
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs

14
test/docker/build.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
hpcoredir=$(realpath ../..)
repo=hotpocketdev/hotpocket
# Build base Ubuntu image.
mkdir -p bin
cp $hpcoredir/build/{hpcore,appbill} $hpcoredir/test/bin/{hpfs,hpws,libblake3.so} ./bin/
strip ./bin/hpcore
docker build -t $repo:ubt.20.04 -f ./Dockerfile.ubt.20.04 ./bin
rm -r bin
# NodeJs image.
docker build -t $repo:ubt.20.04-njs.14 -f ./Dockerfile.ubt.20.04-njs.14 .

7
test/docker/push.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
repo=hotpocketdev/hotpocket
./build.sh
docker push $repo:ubt.20.04
docker push $repo:ubt.20.04-njs.14

View File

@@ -1,24 +1,11 @@
# We are going with NodeJs debian docker image because sample contracts need NodeJs to run.
# Otherwise, hpcore itself can run on any docker image like ubuntu or debian without NodeJs.
FROM node:12.18.3-buster-slim
# We are going with Hot Pocket NodeJs docker image because sample contracts need NodeJs to run.
FROM hotpocketdev/hotpocket:ubt.20.04-njs.14
RUN apt-get update
RUN apt-get install -y libgomp1 libssl-dev gdb valgrind
COPY hpcore hpfs hpws appbill /usr/local/bin/hotpocket/
# Install shared libraries.
# Copy shared libraries and register it.
COPY ./bin/libfuse3.so.3 /usr/local/lib/
COPY ./bin/libblake3.so /usr/local/lib/
RUN ldconfig
COPY ./bin/fusermount3 /usr/local/bin/
# hpcore binary is copied to /hp directory withtin the docker image.
WORKDIR /hp
COPY ./bin/hpcore .
COPY ./bin/hpfs .
COPY ./bin/hpws .
ENTRYPOINT ["/hp/hpcore"]
ENTRYPOINT ["/usr/local/bin/hotpocket/hpcore"]
# Run with valgrind
# ENTRYPOINT ["valgrind", "/hp/hpcore"]
# RUN apt-get install -y gdb valgrind
# ENTRYPOINT ["valgrind", "/usr/local/bin/hotpocket/hpcore"]

View File

@@ -33,13 +33,13 @@ elif [ "$CONTRACT" = "nodefile" ]; then # nodejs file contract (uses BSON protoc
npm install
popd > /dev/null 2>&1
copyfiles="$hpcore/examples/nodejs_contract/{node_modules,package.json,hp-contract-lib.js,file_contract.js}"
binary="/usr/local/bin/node"
binary="/usr/bin/node"
binargs="file_contract.js"
else # nodejs echo contract (default)
echo "Using nodejs echo contract."
copyfiles="$hpcore/examples/nodejs_contract/{package.json,hp-contract-lib.js,echo_contract.js}"
binary="/usr/local/bin/node"
binary="/usr/bin/node"
binargs="echo_contract.js"
fi

View File

@@ -26,4 +26,4 @@ docker run --rm -t -i --network=hpnet --name=node${n} \
-p ${peerport}:${peerport} \
--device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined \
--mount type=bind,source=${clusterloc}/node${n},target=/contract \
hpcore:latest run /contract
hpcore:latest run /contract