linux-386.Dockerfile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # CentOS 7 comes with GLIBC 2.17 which is the most compatible (the lowest)
  2. # version available in a not-too-oudated Linux distribution.
  3. FROM centos:7
  4. RUN yum install --quiet --assumeyes git wget gcc pam-devel zip
  5. # Install Go
  6. RUN wget --quiet https://go.dev/dl/go1.17.7.linux-386.tar.gz -O go.linux-386.tar.gz
  7. RUN sh -c 'echo "5d5472672a2e0252fe31f4ec30583d9f2b320f9b9296eda430f03cbc848400ce go.linux-386.tar.gz" | sha256sum --check --status'
  8. RUN tar -C /usr/local -xzf go.linux-386.tar.gz
  9. ENV PATH="/usr/local/go/bin:${PATH}"
  10. # Install Task
  11. RUN wget --quiet https://github.com/go-task/task/releases/download/v3.10.0/task_linux_386.tar.gz -O task_linux_386.tar.gz
  12. # RUN sh -c 'echo "90bb2d757f5bf621cf0e7fa24a5da8723025b8a862e3939ce74a888ad8ce1722 task_linux_386.tar.gz" | sha256sum --check --status'
  13. RUN tar -xzf task_linux_386.tar.gz \
  14. && mv task /usr/local/bin/task
  15. # THIS IS NOT WORKING
  16. # Build bianry (using raw commands because Task release binary for Linux 386 is not running within container)
  17. WORKDIR /gogs.io/gogs
  18. COPY . .
  19. RUN go build -v \
  20. -ldflags " \
  21. -X 'gogs.io/gogs/internal/conf.BuildTime=$(date -u "+%Y-%m-%d %I:%M:%S %Z")' \
  22. -X 'gogs.io/gogs/internal/conf.BuildCommit=$(git rev-parse HEAD)' \
  23. " \
  24. -tags 'cert pam' \
  25. -trimpath -o gogs
  26. # Pack release archives
  27. RUN rm -rf release \
  28. mkdir -p release/gogs \
  29. cp -r gogs LICENSE README.md README_ZH.md scripts release/gogs \
  30. cd release && zip -r gogs.zip gogs
  31. RUN tar -czf gogs.tar.gz gogs