Skip to content
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

feat: added Dockerfile to build and run CLI tool #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Run "Mnemonic Shamir Secret Sharing Tool" in Docker
# More info: https://github.com/ava-labs/mnemonic-shamir-secret-sharing-cli


##### How to use:
# - start docker daemon
# - `cd` to this directory, then:

### build image once
# docker build -t msss .
### run container
# docker run -it --rm msss

### use tool - see also https://github.com/ava-labs/mnemonic-shamir-secret-sharing-cli
# msss
# msss generate
# msss split -quorum 3 -total 7 -word long -mode phrase
# msss recover -quorum 3 -word long -mode phrase
# exit


##### Dockerfile

# Download base image ubuntu
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt upgrade -y

# Install from ubuntu repository
RUN apt install -y git libssl-dev make clang-14
RUN rm -rf /var/lib/apt/lists/*
RUN apt clean

RUN ln -s /usr/bin/clang-14 /usr/bin/clang
RUN ln -s /usr/bin/clang++-14 /usr/bin/clang++

# Install and build Mnemonic Shamir Secret Sharing repo
RUN git clone https://github.com/ava-labs/mnemonic-shamir-secret-sharing-cli msss
WORKDIR /msss/MnemonicShamirCLI
RUN make

RUN chmod +x build/mnemonic-sss
RUN ln -s build/mnemonic-sss mnemonic-sss
RUN ln -s build/mnemonic-sss m-sss
RUN ln -s build/mnemonic-sss sss
RUN ln -s build/mnemonic-sss msss
ENV PATH="${PATH}:/msss/MnemonicShamirCLI"
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,22 @@ Please enter the first 4 characters of each word of the 24 word mnemonic phrase.
Recovered mnemonic phrase is:
world lawn observe spray wish kit auction focus bone view opera artefact ice mimic expand valve upgrade hour dilemma virtual bread member midnight predict
```

### Build and run in Docker

Start the docker daemon and navigate to this directory, then
- build the Docker image once
```sh
docker build -t msss .
```
- start an interactive container
```sh
docker run -it --rm msss
```
- run your commands as documented above, e.g.
```sh
./mnemonic-sss generate

# or use shortcut:
msss generate
```