Add docker image
This commit is contained in:
parent
276b2c655a
commit
5b2801b0b2
|
@ -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
|
|
@ -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
|
||||
```
|
|
@ -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
|
Loading…
Reference in New Issue