Dockerfile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. FROM tianon/docker-tianon
  2. RUN set -eux; \
  3. apt-get update; \
  4. apt-get install -y --no-install-recommends \
  5. # wget for downloading files (especially in tests, which run in this environment)
  6. ca-certificates \
  7. wget \
  8. # git for cloning source code
  9. git \
  10. ; \
  11. # go for compiling bashbrew (backports to get new enough version and to make it work on s390x)
  12. suite="$(awk '$1 == "deb" && $4 == "main" && $3 !~ /[\/-]/ { print $3; exit }' /etc/apt/sources.list)"; \
  13. echo "deb http://deb.debian.org/debian $suite-backports main" > /etc/apt/sources.list.d/backports.list; \
  14. apt-get update; \
  15. apt-get install -y --no-install-recommends -t "$suite-backports" \
  16. golang-go \
  17. ; \
  18. rm -rf /var/lib/apt/lists/*
  19. ENV GOPATH /go
  20. ENV PATH $GOPATH/bin:$PATH
  21. ENV DIR /usr/src/official-images
  22. ENV PATH $DIR/bashbrew/go/bin:$PATH
  23. ENV BASHBREW_LIBRARY $DIR/library
  24. ENV BASHBREW_CACHE /bashbrew-cache
  25. # make sure our default cache dir exists and is writable by anyone (similar to /tmp)
  26. RUN mkdir -p "$BASHBREW_CACHE" \
  27. && chmod 1777 "$BASHBREW_CACHE"
  28. # (this allows us to decide at runtime the exact uid/gid we'd like to run as)
  29. WORKDIR $DIR
  30. COPY . $DIR
  31. RUN set -ex; \
  32. cd bashbrew/go; \
  33. export GOPATH="$PWD:$PWD/vendor"; \
  34. cd src; \
  35. CGO_ENABLED=0 go install -v ./...
  36. VOLUME $BASHBREW_CACHE
  37. RUN ln -s "$PWD/bashbrew/bashbrew-entrypoint.sh" /usr/local/bin/bashbrew-entrypoint.sh
  38. ENTRYPOINT ["bashbrew-entrypoint.sh"]