Skip to content

Commit

Permalink
Merge pull request #7 from th3w4y/patch-1
Browse files Browse the repository at this point in the history
added logic to support both master and dev branch or different fork
  • Loading branch information
nivong authored Aug 24, 2016
2 parents 95821bb + 74e67ed commit e228f6f
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
# To build a docker container for the "master" branch (this is the default) execute:
#
# docker build --build-arg BUILD_BRANCH=master .
# (or)
# docker build .
#
# To build a docker container for the "dev" branch execute:
#
# docker build --build-arg BUILD_BRANCH=dev .
#
# You can also build from different fork and specify a particular commit as the branch
#
# docker build --build-arg BUILD_REPO=YourFork/PokemonGo-Bot --build-arg BUILD_BRANCH=6a4580f .


FROM python:2.7.12-alpine

RUN apk add --update --no-cache alpine-sdk git

ADD https://github.com/PokemonGoF/PokemonGo-Bot/archive/dev.tar.gz .
RUN tar -zxvf dev.tar.gz && mv PokemonGo-Bot-dev /usr/src/app && rm dev.tar.gz
ARG BUILD_BRANCH
ENV BUILD_BRANCH ${BUILD_BRANCH:-master}

ARG BUILD_REPO
ENV BUILD_REPO ${BUILD_REPO:-PokemonGoF/PokemonGo-Bot}

LABEL build_repo=$BUILD_REPO build_branch=$BUILD_BRANCH

ADD https://github.com/$BUILD_REPO/archive/$BUILD_BRANCH.tar.gz .
RUN tar -zxvf $BUILD_BRANCH.tar.gz && mv PokemonGo-Bot-* /usr/src/app && rm $BUILD_BRANCH.tar.gz

WORKDIR /usr/src/app
VOLUME ["/usr/src/app/configs", "/usr/src/app/web"]
Expand All @@ -30,3 +53,9 @@ RUN apk del alpine-sdk\
&& rm -rf /var/cache/apk/*

ENTRYPOINT ["python", "pokecli.py"]

#remove unused stuff
RUN apk del alpine-sdk\
&& rm -rf /var/cache/apk/*

ENTRYPOINT ["python", "pokecli.py"]

0 comments on commit e228f6f

Please sign in to comment.