Dockerfile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. # ssl for downloading files
  8. libressl \
  9. # coreutils for real "tac" so it isn't busybox-buggy (where it seems to fail if the pipe is closed prematurely, which defeats the whole purpose of the "tac|tac" idiom)
  10. coreutils
  11. ENV GOPATH /go
  12. ENV PATH $GOPATH/bin:$PATH
  13. ENV DIR /usr/src/official-images
  14. ENV PATH $DIR/bashbrew/go/bin:$PATH
  15. ENV BASHBREW_LIBRARY $DIR/library
  16. ENV BASHBREW_CACHE /bashbrew-cache
  17. # make sure our default cache dir exists and is writable by anyone (similar to /tmp)
  18. RUN mkdir -p "$BASHBREW_CACHE" \
  19. && chmod 1777 "$BASHBREW_CACHE"
  20. # (this allows us to decide at runtime the exact uid/gid we'd like to run as)
  21. WORKDIR $DIR
  22. COPY . $DIR
  23. RUN set -ex; \
  24. cd bashbrew/go; \
  25. export GOPATH="$PWD:$PWD/vendor"; \
  26. cd src; \
  27. go install -v ./...
  28. VOLUME $BASHBREW_CACHE
  29. RUN ln -s "$PWD/bashbrew/bashbrew-entrypoint.sh" /usr/local/bin/bashbrew-entrypoint.sh
  30. ENTRYPOINT ["bashbrew-entrypoint.sh"]