Skip to content

Commit

Permalink
Update dockerfile to use apt build and add quay push
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzampolin committed Aug 24, 2017
1 parent 6ef38be commit 1fa5fab
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
18 changes: 7 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# Run in Ubuntu
FROM ubuntu:xenial

# Create directory for build
RUN mkdir -p /src/blockstack
# Update apt and install wget
RUN apt update && apt install -y wget

# Copy in source files
COPY . /src/blockstack
WORKDIR /src/blockstack
# Add blockstack apt repo
RUN wget -qO - https://raw.githubusercontent.com/blockstack/packaging/master/repo-key.pub | apt-key add -
RUN echo 'deb http://packages.blockstack.com/repositories/ubuntu/ xenial main' > /etc/apt/sources.list.d/blockstack.list

# Install Dependancies
RUN apt-get update && apt-get install -y python-pip python-dev build-essential apt-utils libssl-dev libffi-dev rng-tools libgmp3-dev sudo software-properties-common sqlite3 lsof
RUN pip2 install --upgrade pip
RUN pip2 install --upgrade virtualenv
# Install blockstack
RUN apt update && apt install -y blockstack

# Build Blockstack
RUN pip2 install . --upgrade
22 changes: 15 additions & 7 deletions bsdocker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

build () {
echo "Building blockstack docker image. This might take a minute..."
docker build -t blockstack:latest .

docker build -t quay.io/blockstack/blockstack-core:latest .
}

setup () {
if [ $# -eq 0 ]; then
echo "Need to input new wallet password when running setup: ./bsdocker setup mypass"
exit 1
fi
docker run -it -v $HOME/.blockstack:/root/.blockstack blockstack:latest blockstack setup -y --password $1
docker run -it -v $HOME/.blockstack:/root/.blockstack blockstack:latest sed -i 's/api_endpoint_bind = localhost/api_endpoint_bind = 0.0.0.0/' /root/.blockstack/client.ini
docker run -it -v $HOME/.blockstack:/root/.blockstack blockstack:latest sed -i 's/api_endpoint_host = localhost/api_endpoint_host = 0.0.0.0/' /root/.blockstack/client.ini
docker run -it -v $HOME/.blockstack:/root/.blockstack quay.io/blockstack/blockstack-core:latest blockstack setup -y --password $1
docker run -it -v $HOME/.blockstack:/root/.blockstack quay.io/blockstack/blockstack-core:latest sed -i 's/api_endpoint_bind = localhost/api_endpoint_bind = 0.0.0.0/' /root/.blockstack/client.ini
docker run -it -v $HOME/.blockstack:/root/.blockstack quay.io/blockstack/blockstack-core:latest sed -i 's/api_endpoint_host = localhost/api_endpoint_host = 0.0.0.0/' /root/.blockstack/client.ini
}

start () {
Expand All @@ -38,9 +38,9 @@ start () {
# If there is no existing blockstack-api container, run one
# Linux needs to mount /tmp:/tmp
if [[ $(uname) == 'Linux' ]]; then
docker run -d --name blockstack-api -v $HOME/.blockstack:/root/.blockstack -v /tmp/:/tmp/ -p 6270:6270 blockstack:latest blockstack api start-foreground --password $1 --debug
docker run -d --name blockstack-api -v $HOME/.blockstack:/root/.blockstack -v /tmp/:/tmp/ -p 6270:6270 quay.io/blockstack/blockstack-core:latest blockstack api start-foreground --password $1 --api_password $1 --debug
elif [[ $(uname) == 'Darwin' ]]; then
docker run -d --name blockstack-api -v $HOME/.blockstack:/root/.blockstack -p 6270:6270 blockstack:latest blockstack api start-foreground --password $1 --debug
docker run -d --name blockstack-api -v $HOME/.blockstack:/root/.blockstack -p 6270:6270 blockstack:latest blockstack api start-foreground --password $1 --api_password $1 --debug
fi
fi

Expand All @@ -61,6 +61,11 @@ logs () {
docker logs blockstack-api -f
}

push () {
echo "pushing build container up to quay.io..."
docker push quay.io/blockstack/blockstack-core:latest
}

commands () {
cat <<-EOF
bsdocker commands:
Expand Down Expand Up @@ -92,6 +97,9 @@ case $1 in
start)
start $2
;;
push)
push
;;
*)
commands
;;
Expand Down

0 comments on commit 1fa5fab

Please sign in to comment.