Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for s390x and ppc64le #44

Closed
james-crowley opened this issue Mar 4, 2021 · 7 comments
Closed

Add Support for s390x and ppc64le #44

james-crowley opened this issue Mar 4, 2021 · 7 comments

Comments

@james-crowley
Copy link

It looks like to generate the Dockeriles and manifests, you are using buildx. I see currently support for a couple architectures, but would you be willing to add s390x and ppc64le support?

Looks like the defaults/values would need to be changed in a couple places:

PLATFORMS=${PLATFORMS:-"linux/amd64 linux/arm64 linux/arm/v7"}

platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7"]

Plus the readme!

To enable support it should be linux/s390x and linux/ppc64le.

@prodrigestivill Would you be open to build for those platforms as well? If so, I can open a PR.

@prodrigestivill
Copy link
Owner

It will also be needed to build the prodrigestivill/go-cron for this platforms.
I will have to lookup information on how to build this targets in go.

@prodrigestivill
Copy link
Owner

I have build go-cron for the 2 new platforms.

But building the docker image with buildx for linux/s390x is not working with the following error when trying to install curl:

Error while loading /usr/sbin/dpkg-split: No such file or directory
Error while loading /usr/sbin/dpkg-deb: No such file or directory

It looks like the essential package dpkg is missing from the postgres Debian image.

So ppc64le is been added, but the s390x is still missing for Debian tags, can you please debug it and find a solution for the issue?

@james-crowley
Copy link
Author

@prodrigestivill Thanks for taking care of ppc64le! Glad that just worked! Little weird why s390x would not work out of the bag.

Looks like a path issue. I did see some issues with paths and that error. Oddly enough, when I hop onto a s390x system and run:

root@99278c17b09c:/# export GOCRONVER=v0.0.10
root@99278c17b09c:/# export TARGETOS=linux
root@99278c17b09c:/# export TARGETARCH=s390x
root@99278c17b09c:/# set -x \
> && apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/* \
> && curl -L https://github.com/prodrigestivill/go-cron/releases/download/$GOCRONVER/go-cron-$TARGETOS-$TARGETARCH.gz | zcat > /usr/local/bin/go-cron \
> && chmod a+x /usr/local/bin/go-cron \
> && apt-get purge -y --auto-remove ca-certificates && apt-get clean
+ apt-get update

The command completes fine with: (I cut the logs short just so show the point)

+ chmod a+x /usr/local/bin/go-cron
+ apt-get purge -y --auto-remove ca-certificates
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  ca-certificates*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 412 kB disk space will be freed.
(Reading database ... 12035 files and directories currently installed.)
Removing ca-certificates (20200601~deb10u2) ...
Removing dangling symlinks from /etc/ssl/certs... done.
(Reading database ... 11871 files and directories currently installed.)
Purging configuration files for ca-certificates (20200601~deb10u2) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Removing dangling symlinks from /etc/ssl/certs... done.
+ apt-get clean

Must be a problem with buildx and how its handling something. I know its not perfect, but let me try adjust the PATH and see if that solves anything.

@prodrigestivill
Copy link
Owner

Yes it could be a buildx issue. But I already tried to just build s390x and the error persists.
Do you have acces to bare metal s390x? Can you try building directly if there is any issue there?

docker build --pull --build-arg "BASETAG=12" --build-arg "GOCRONVER=v0.0.10" -f debian.Dockerfile

Apart from that currently it is a nightmare to build and push with it with this many targets.
As currently buildx is not pushing all the tags to the repository as reported in docker/buildx#98.

I will try to investigate further once this push issue is fixed.

@james-crowley
Copy link
Author

james-crowley commented Mar 8, 2021

@prodrigestivill Build on bare metal works fine. I do have access to s390x and ppc64le resources.

I think something is going wrong with buildx and its paths. In this issue it was armv7 support: docker/buildx#495

I got it working by adding these syslinks to the Dockerfile:

RUN ln -s /usr/bin/dpkg-split /usr/sbin/dpkg-split && ln -s /usr/bin/dpkg-deb /usr/sbin/dpkg-deb && ln -s /bin/tar /usr/sbin/tar

I know that is not an ideal fix, but I am not sure what exactly is going wrong with buildx. I try to stay away from it since qemu emulation works 95% of the time, but when you get into low level code, like C, you run into weird issues.

Would you be willing to add the syslinks to the RUN command you have already?

prodrigestivill added a commit that referenced this issue Oct 28, 2021
@prodrigestivill
Copy link
Owner

Uploaded newly build images from 9.6 to 14.

@prodrigestivill
Copy link
Owner

Due to missing upstream image, debian versions for postgresql 10 and 11 has been removed as fixed in 888459f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants