Skip to content

Build issue (cross-build) after moving to time/tzdata for timezone in docker #13070

@gioboske

Description

@gioboske
  • Gitea version (or commit ref): 14e7186 (onwards)
  • Git version: not relevant
  • Operating system: docker on macOS for arm32v6/v7 cross build
  • Database (use [x]):
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Not relevant
  • Log gist:

Description

After changing the Dockerfile to use time/tzdata for timezone in docker (#12922), trying to cross-build the docker image for arm32 (host macOS, target linux/arm/v6 or v7) fails with the following error:

[...]
# code.gitea.io/gitea
time/tzdata.init.0: unresolved inter-package jump to time.registerLoadFromEmbeddedTZData(time) from time/tzdata
make: *** [Makefile:553: gitea] Error 2
The command '/bin/sh -c if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi  && make clean-all build' returned a non-zero code: 2
make: *** [build] Error 2

Oddly, the cross-compilation for arm64 raise no error and the resulting image is fully functional.

Not sure if the issue is related to the golang:1.15-alpine3.12 image used as build environment, if it is related to QEMU or if it is related to gitea itself.

Changing back the docker file by removing timetzdata from ENV TAGS (in the build environment image) and adding again the tzdata package to the final image seems to solve the issue.

It would be great to rely on a single Dockerfile both for native and cross-compilation, so to keep any docker image building as simple as docker build --platform xxxx/xxx --build-arg XXX -t image:tag gitea.

Thank you for your support!

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtopic/buildPR changes how Gitea is built, i.e. regarding Docker or the Makefiletype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions