Dockerfile 820 B

1234567891011121314151617181920212223242526272829303132333435
  1. FROM docker:stable-git
  2. RUN apk add --no-cache \
  3. # bash for running scripts
  4. bash \
  5. # go for compiling bashbrew
  6. go libc-dev
  7. ENV GOPATH /go
  8. ENV PATH $GOPATH/bin:$PATH
  9. ENV DIR /usr/src/official-images
  10. ENV PATH $DIR/bashbrew/go/bin:$PATH
  11. ENV BASHBREW_LIBRARY $DIR/library
  12. ENV BASHBREW_CACHE /bashbrew-cache
  13. # make sure our default cache dir exists and is writable by anyone (similar to /tmp)
  14. RUN mkdir -p "$BASHBREW_CACHE" \
  15. && chmod 1777 "$BASHBREW_CACHE"
  16. # (this allows us to decide at runtime the exact uid/gid we'd like to run as)
  17. WORKDIR $DIR
  18. COPY . $DIR
  19. RUN set -ex; \
  20. cd bashbrew/go; \
  21. export GOPATH="$PWD:$PWD/vendor"; \
  22. cd src; \
  23. go install -v ./...
  24. VOLUME $BASHBREW_CACHE
  25. RUN ln -s "$PWD/bashbrew/bashbrew-entrypoint.sh" /usr/local/bin/bashbrew-entrypoint.sh
  26. ENTRYPOINT ["bashbrew-entrypoint.sh"]