Open gioboske opened 4 years ago
QEMU is not the cause here.
I confirm this bug also happens when building :
Your workaround works in this case too (many thanks).
@techknowlogick any idear?
I can confirm this problem while building the image with an arm32 based QNAP nas. (TS-231P2).
I have this same problem when building on a raspberry pi 4 with raspbian (armv71, 32 bit). For me doing the reverse of #12922 makes the build work again
I have this same problem when building on a raspberry pi 4 with raspbian (armv71, 32 bit). For me doing the reverse of #12922 makes the build work again
I basically agree with you, but I guess it would mean giving up the possibility to embed the timezone database into gitea, using the new package included in go1.15. However, I'm not really skilled on that, so maybe it is better to wait for the feedback of the gitea develop team...
I see two points: revert 12922 and/or fix arm x32 issue in go upstream
AFAIK, some docker images use the timezone of the host machine (via some clever /etc/x mappings) and avoid 800KB of overhead : https://golang.org/doc/go1.15#time/tzdata For ARM boards this can make a difference. I'd love to see build time options to chose the way timezone works in gitea.
@bolet: so (just for my understanding, again sorry I'm not so skilled on that), your proposal would be to support different options, such as:
option 1 (avoiding 800KB overhead)
import _ "time/tzdata"
nor -tags timetzdata
tzdata
in the gitea docker imageoption 2 (timezone db in docker image)
option 3 (embedding the timezone database at build time)
Is my understanding correct?
@gioboske Yes, I think you summed it all pretty well.
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Damn, #12922 killed the simplest way to build gitea loacally on a arm7 (armhf) based Raspi 4. Up to this point it was really simple to buld the temporary disabled arm7 build:
version: "3.3"
services:
gitea:
container_name: gitea
build:
context: https://github.com/go-gitea/gitea.git#release/v1.12
image: ocram85/gitea:1.12
environment:
- USER_UID=1000
- USER_GID=1000
- DB_TYPE=postgres
- DB_HOST=gitea_db:5432
- DB_NAME=1234
- DB_USER=g123434
- DB_PASSWD=gitea
restart: unless-stopped
depends_on:
- gitea_db
volumes:
- ./volumes/gitea/data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
...
...
[x]
):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:
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
fromENV TAGS
(in the build environment image) and adding again thetzdata
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!