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

aarch64 docker images missing #59

Open
KlavsKlavsen opened this issue Jul 27, 2023 · 20 comments
Open

aarch64 docker images missing #59

KlavsKlavsen opened this issue Jul 27, 2023 · 20 comments
Assignees

Comments

@KlavsKlavsen
Copy link

Hi,

I'm trying to get this to run on my orangepi (same as raspberry pi) - aarch64 architecture - but you only release amd64 builds unfortunately.

Trying to do docker build from this repo for some reason (I have yet to find) fails on my aarch64 ubuntu install:

 r$ docker build . -t tekki/sql-ledger:aarch64
Sending build context to Docker daemon   5.12kB
Step 1/5 : FROM httpd:bullseye
bullseye: Pulling from library/httpd
92ad47755700: Pull complete 
70a8c7ffcd85: Pull complete 
69b764e3301e: Pull complete 
0c9233d952bc: Pull complete 
c0d2d61c783c: Pull complete 
Digest: sha256:4bdb49b01ab1a7b019410337588f772eebe6ae01d038987aa849fcb798fbf26f
Status: Downloaded newer image for httpd:bullseye
 ---> ffae72c8d8b4
Step 2/5 : RUN set -ex   && apt-get update   && apt-get install -y --no-install-recommends     ca-certificates     libarchive-extract-perl     libarchive-zip-perl     libdbd-pg-perl     libexcel-writer-xlsx-perl     libio-socket-ssl-perl     libmojolicious-perl     posgresql-client   && rm -rf /var/lib/apt/lists/*
 ---> Running in 0fc6994ee5b6
+ apt-get update
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:4 http://deb.debian.org/debian bullseye/main arm64 Packages [8071 kB]
Get:5 http://deb.debian.org/debian-security bullseye-security/main arm64 Packages [248 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main arm64 Packages [12.1 kB]
Fetched 8539 kB in 3s (3265 kB/s)
Reading package lists...
+ apt-get install -y --no-install-recommends ca-certificates libarchive-extract-perl libarchive-zip-perl libdbd-pg-perl libexcel-writer-xlsx-perl libio-socket-ssl-perl libmojolicious-perl posgresql-client
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package posgresql-client
The command '/bin/sh -c set -ex   && apt-get update   && apt-get install -y --no-install-recommends     ca-certificates     libarchive-extract-perl     libarchive-zip-perl     libdbd-pg-perl     libexcel-writer-xlsx-perl     libio-socket-ssl-perl     libmojolicious-perl     posgresql-client   && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
@Tekki Tekki self-assigned this Jul 27, 2023
@Tekki
Copy link
Owner

Tekki commented Jul 28, 2023

Hi Klavs

E: Unable to locate package posgresql-client

That's a typo, the package is called postgresql-client, not posgre.... Wonder where it comes from, I don't find it anywhere in my code. But before you simply correct it, please read the rest:

I didn't publish an amd64 image either since a long time. First because I'm not aware of anyone who uses it, and mainly because I think this program is not appropriate to be distributed with Docker, as long as we can't split it up into smaller components.

You should not mix the Dockerfiles from this and the docker-sql-ledger repo. The one in this repo is for development purposes and only creates a web server that runs SQL-Ledger, with code on the local machine and without the additional components. If you need a complete system, you have to start from debian:bullseye (or debian:bookworm nowadays), not from httpd:bullseye.

As soon as you start to create PDFs, you will not be happy with a Raspi or a Raspi-like platform. PDFs are generated with LaTeX that not only consumes most of the space in the image, but needs a lot of computing power.

@KlavsKlavsen
Copy link
Author

the arm architecture has become quite useable for such stuff.. We use it for kubernetes controllers, and the orangepi5 http://www.orangepi.org/orangepiwiki/index.php/Orange_Pi_5 - is quite capable 8-core BigLittle system :) - and uses very little power, compared to intel/amd cpus - and it runs latex without issues for PDF generation nowadays :) (this system has 16gb memory)

We run everything we have in Kubernetes - which means inside docker. You can easily run "old style apps" - like that - and run postgresql and sql-ledger seperately - it won't know the difference - as long as you've correctly ensured the "specific folders" that it needs to write to - are in fact managed by persistent volumes (ie. data is kept) - or in docker terms - that its got a volume attached there.

You seem to be maintaining your improved sql-ledger version regularly - so I wanted to try and run that.. and preferrably in docker.. but I could spinup an lxc.. they're just more hassle to maintain.
I would be perfectly fine with sql-ledger app docker image, and postgres in sep. container from pgsql upstream

@Tekki
Copy link
Owner

Tekki commented Jul 31, 2023

Yes, hits repo is regularly updated. My company and some of our customers use this software in production.

I see I have to test some of the new arm devices (when I have time for it).

I know that it's possible to run it in Docker and I already use some more complete images for special development purposes. What I don't like is that this image is bigger than 1 GB and if it runs on a server that is publicly accessible you have to replace it every few days to get the new security updates.

The question is if your really need an arm image or if it would be enough (at least for the beginning) if I update the Dockerfiles and you use them to create your own images.

@KlavsKlavsen
Copy link
Author

It would be more than enough with just updated dockerfiles - and I'll gladly share an aarch64build if you'd like to help others who can't just build themselves..
If you want it to take up less space - you can do 2 things:

  1. if some of the things installed are used only for build - you can do a 2-step dockerfile - so it only keeps the "last part" - for the image - so build data is not included - and you can also remove/cleanup stuff that maybe gets installed by packages you install (if thats the case).
    Latex packages are heavy in size as far as I remember :)
  2. base it on a common image (you already use debian) - then it should not add as much.

I must admit though, that I have a 500gb NVMe attached to my orangepi 5 - so I don't care about a 1gb image :)

@KlavsKlavsen
Copy link
Author

backup and recovery is soo much easier in docker (and you know you don't forget anything as its easier to test as well) - and as we run all our stuff in k8s - it means we can have ONE set of backup policies for postgresql - and every pg instance in any cluster we have - is managed by the same rules and recovery methods and pushed to central s3 storage (on our own servers). Its just so damn easy to do operations once you have that :)
Its why we build an open source operations setup - called https://k8id.io - so us poor operations people can collaborate a bit more than has been the norm, and sharing the work on the important nitty gritty, and get more time on our hands :)

@Tekki
Copy link
Owner

Tekki commented Jul 31, 2023

If you want it to take up less space...

What needs so much space are just Debian packages. I've tried to split the image into more layers, in the hope that only some of them have to be replaced, with no success.

@Tekki
Copy link
Owner

Tekki commented Jul 31, 2023

There is an updated image on Dockerhub now and a new Dockerfile at https://github.com/Tekki/docker-sql-ledger/blob/master/main/Dockerfile. Can you try to build an aarch64 image with it?
I haven't made too many tests with it, so it's possible that some things are not working. And I realize this moment that the Liberation fonts are missing that we use on our production systems.

@KlavsKlavsen
Copy link
Author

@Tekki I can now built fine - and when docker-compose tries to start sl-app -i t fails with:
cp: cannot stat 'sql-ledger.conf.default': No such file or directory

so its not completely happy :)

@Tekki
Copy link
Owner

Tekki commented Aug 2, 2023

cp: cannot stat 'sql-ledger.conf.default': No such file or directory

I only find this file mentined in setup.pl which is not used in my code.
Were all the files from https://github.com/Tekki/docker-sql-ledger/tree/master/main present when you built the image and are all volumes connected on startup?
You see here that the entrypoint script creates a conf file on startup, but this one has the ending conf, not conf.default.

@Tekki
Copy link
Owner

Tekki commented Aug 8, 2023

Are there any updates on this? I think I need to know more details about what exactly you are doing.

@KlavsKlavsen
Copy link
Author

I'm sorry.. kids still on vacation (at home) - and trying to work alongside that and a busy period.. :)
I'm simply doing docker-compose up - on the compose file included as example in repo

@KlavsKlavsen
Copy link
Author

Its very odd.. I copy pasted your docker-compose.yml - and replaced sql-ledger-test:0.14 image with my own build one, that I build from this repo - standing in docker folder and running: docker build . -t tekkie-sql-ledger:aarch64 (and it builds fine).

@KlavsKlavsen
Copy link
Author

$ docker run tekki-sql-ledger:aarch64
cp: cannot stat 'sql-ledger.conf.default': No such file or directory

@KlavsKlavsen
Copy link
Author

since your docker image has no CMD nor entrypoint set - it must inherit the one from httpd:bookworm - and it runs whats defined there.. (going to find that :) ?

@KlavsKlavsen
Copy link
Author

docker inspect says entrypoint is null.. and I see no CMD in docker inspect output.. so what does it actually run?

@KlavsKlavsen
Copy link
Author

the WorkingDir you set in your docker-compose.yml is empty..
if I do this: docker run -it -v /home/klavs/tekki-sql-ledger:/usr/local/apache2/htdocs/sql-ledger tekki-sql-ledger:aarch64
it starts up..
I assume thats what you meant to do with the docker-compose.. but thats not what it does

@Tekki
Copy link
Owner

Tekki commented Aug 14, 2023

Sorry for the late answer. I don't have much time either.
Maybe my first comment about not mixing the Dockerfiles was too cryptic.
If you are going to run SQL-Ledger in a container for production, you are at wrong place here. There are two repos, this one that is for development and docker-sql-ledger that is linked from Dockerhub where you find all the code on which the images on Dockerhub are based. Never take a Dockerfile or a compose script from this repo (the repo where we are now) unless you are going to change the source of SQL-Ledger.
If you build a Docker image for production, download at least all the files from folder main.

@KlavsKlavsen
Copy link
Author

If you add this to the bottom of your docker-compose file - it starts up:

    volumes:
      - sqlledger:/usr/local/apache2/htdocs/sql-ledger

volumes:
  db:
  pgadmin:
  sqlledger:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: /path/to/gitclone-of-this-repo/

@KlavsKlavsen
Copy link
Author

and sql-ledger Version 3.2.12 - responds on the host under /sql-ledger/ yay

@KlavsKlavsen
Copy link
Author

KlavsKlavsen commented Sep 1, 2023

Works with a proper docker volume cleanup as well - from the repo you pointed to..

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

No branches or pull requests

2 participants