polkadot-js/tools

View on GitHub
docker/Dockerfile.tmpl

Summary

Maintainability
Test Coverage
# `Dockerfile` is generated from `Dockerfile.tmpl` via `docker.sh`
#
# To make build changes and have it reflect via the `Dockerfile`, you
# would make any build changes to `Dockerfile.tmpl`. `docker.sh build`
# takes this, adds the version from `package.json` and pulls a package
# from npm to do the the actual versioned build

# base image
FROM ubuntu:latest

# Run package updates
RUN apt-get update && \
  apt-get install -y build-essential curl gcc g++ gnupg make git
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y nodejs

# install latest from npm (install as root, we assume we are secure inside...)
RUN NPM_CONFIG_USER=root npm install -g @polkadot/api-cli@VERSION @polkadot/json-serve@VERSION @polkadot/metadata-cmp@VERSION @polkadot/monitor-rpc@VERSION @polkadot/signer-cli@VERSION @polkadot/vanitygen@VERSION

# copy the cli wrapper to this container
COPY cli.sh .

# run the cli wrapper with options as passed
ENTRYPOINT ["./cli.sh"]