Add docker image

This commit is contained in:
armaniferrante 2020-09-13 13:39:32 -07:00
parent 276b2c655a
commit 5b2801b0b2
No known key found for this signature in database
GPG Key ID: 58BEF301E91F7828
3 changed files with 70 additions and 0 deletions

19
docker/Makefile Normal file
View File

@ -0,0 +1,19 @@
IMG_ORG ?= projectserum
IMG_VER ?= latest
WORKDIR=$(PWD)
.PHONY: development development-push development-shell
default:
development: development/Dockerfile
@docker build $@ -t $(IMG_ORG)/$@:$(IMG_VER)
development-push:
@docker push $(IMG_ORG)/development:$(IMG_VER)
development-shell:
@docker run -ti --rm \
-v $(WORKDIR)/..:/workdir \
$(IMG_ORG)/development:$(IMG_VER) bash

24
docker/README.md Normal file
View File

@ -0,0 +1,24 @@
# Docker
A development docker image is used in CI to build and test the project.
## Development
To build the development image run
```
make development
```
To push to dockerhub, assuming you have push access, run
```
make development-push
```
To run the development image locally (if you don't want to install all the
dependencies yourself), run
```
make development-shell
```

View File

@ -0,0 +1,27 @@
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
ARG SOLANA_CHANNEL=v1.2.17
# Install base utilities.
RUN mkdir -p /workdir && mkdir -p /tmp && \
apt-get update -qq && apt-get upgrade -qq && apt-get install -qq \
build-essential git curl
ENV HOME="/root"
ENV PATH="${HOME}/.cargo/bin:${PATH}"
# Install rust.
RUN curl "https://sh.rustup.rs" -sfo rustup.sh && \
sh rustup.sh -y && \
rustup component add rustfmt clippy
# Install Solana tools.
RUN curl -L --retry 5 --retry-delay 2 -o bpf-sdk.tar.bz2 http://solana-sdk.s3.amazonaws.com/${SOLANA_CHANNEL}/bpf-sdk.tar.bz2 && \
rm -rf bpf-sdk && \
mkdir -p bpf-sdk && \
tar jxf bpf-sdk.tar.bz2 && \
rm -f bpf-sdk.tar.bz2
WORKDIR /workdir