diff --git a/compose/docker-compose-test.yml b/compose/docker-compose-test.yml new file mode 100644 index 00000000..058b2b3b --- /dev/null +++ b/compose/docker-compose-test.yml @@ -0,0 +1,5 @@ +version: "3.2" +services: + test: + image: cerc/test-container:local + restart: always diff --git a/container-build/cerc-test-container/Dockerfile b/container-build/cerc-test-container/Dockerfile new file mode 100644 index 00000000..29b42a84 --- /dev/null +++ b/container-build/cerc-test-container/Dockerfile @@ -0,0 +1,5 @@ +FROM alpine:latest + +COPY run.sh /app/run.sh + +ENTRYPOINT ["/app/run.sh"] diff --git a/container-build/cerc-test-container/build.sh b/container-build/cerc-test-container/build.sh new file mode 100755 index 00000000..1595645c --- /dev/null +++ b/container-build/cerc-test-container/build.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Build cerc/test-container +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +docker build -t cerc/test-container:local -f ${SCRIPT_DIR}/Dockerfile $SCRIPT_DIR \ No newline at end of file diff --git a/container-build/cerc-test-container/run.sh b/container-build/cerc-test-container/run.sh new file mode 100755 index 00000000..5f59acab --- /dev/null +++ b/container-build/cerc-test-container/run.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# Test if the container's filesystem is old (run previously) or new +EXISTSFILENAME=/var/exists +echo "Test container starting" +if [[ -f "$EXISTSFILENAME" ]]; +then + TIMESTAMP = `cat $EXISTSFILENAME` + echo "Filesystem is old, created: $TIMESTAMP" +else + echo "Filesystem is fresh" + echo `date` > $EXISTSFILENAME +fi + +# Sleep forever to keep docker happy +while true; do sleep 10; done \ No newline at end of file diff --git a/container-image-list.txt b/container-image-list.txt index fd2fe645..80cef725 100644 --- a/container-image-list.txt +++ b/container-image-list.txt @@ -11,4 +11,5 @@ cerc/ipld-eth-server cerc/laconicd cerc/laconic-cns-cli cerc/fixturenet-eth-geth -cerc/fixturenet-eth-lighthouse \ No newline at end of file +cerc/fixturenet-eth-lighthouse +cerc/test-container diff --git a/pod-list.txt b/pod-list.txt index 09a7baa5..d07d3d08 100644 --- a/pod-list.txt +++ b/pod-list.txt @@ -9,3 +9,4 @@ lighthouse prometheus-grafana laconicd fixturenet-eth +test