Closed finnie2006 closed 1 year ago
Hello!
I built an arm64 image with:
# Register QEMU binaries
docker run --privileged --rm tonistiigi/binfmt --install all
# Check available platforms
docker buildx ls
# Build image with platform
cd samba-ad-dc
docker buildx build --platform="linux/arm64" -f dockerfiles/almalinux --tag samba:arm64 .
In the future I can add that to the main repo, but I need to learn more about the docker buildx driver for multplatform builds. Please try this and any trouble let me know.
So, it was easier than I expected (source), but the emulated build process is very slow. Arm64 platform image added. Please test using the diegogslomp/samba-ad-dc:arm64
version and any trouble let me know.
Cool i will test it in an hour
Traceback (most recent call last):
File "/usr/local/samba/bin/samba-tool", line 34, in <module>
from samba.netcmd.main import samba_tool
File "/usr/local/samba/lib64/python3.9/site-packages/samba/__init__.py", line 28, in <module>
import ldb
ModuleNotFoundError: No module named 'ldb'
It seems that the python3-ldb should be installed, on monday I'll add it to the dependencies and we test it again.
I will try it i know how to modify the dockerfile and build using buildx i will let you know
I'm trying to build it but it is too slow.. and I need to go.. so
You can build with
docker buildx build --platform="linux/arm64" -f dockerfiles/almalinux --tag samba:arm64 .
Just add python3-ldb to the install dependencies in the dockerfiles/almalinux
file
👍🏻, i an running ubuntu btw should i pick the ubuntu dockerfile?
You can build the ubuntu image too.. but the dockerhub image is based in almalinux. Your host can be any other distro too.
Oh like that
Building it, but is compiling really required? or should there be a way to modify it by just installing the samba package Also the image is pretty big
If the error happens after the build you can try install the package after all process. I'll start to build the image now and I'll upload it in the sequence.
Image uploaded, please check if the ldb error is happening now
I will try, when i tried the non working image from yesterday i saw that the container was over 1gb that is pretty big for a container but hm
It is big, since this image compiles samba from source there are many dependencies.
REPOSITORY TAG IMAGE ID CREATED SIZE
samba rockylinux b59a12e8a6ff 12 seconds ago 1.06GB
samba debian 12144e37c344 12 seconds ago 1.17GB
samba almalinux e958cef7dac5 12 seconds ago 1.06GB
samba ubuntu 66bc9b8700a1 14 seconds ago 1.13GB
The ubuntu image has a samba that can be installed from the repository, you can try using that if you need a smaller image.
Oh oke, pulling it
unfortunately it gave an error again
ModuleNotFoundError: No module named 'samba.param'
Traceback (most recent call last):
File "/usr/local/samba/bin/samba-tool", line 34, in <module>
from samba.netcmd.main import samba_tool
File "/usr/local/samba/lib64/python3.9/site-packages/samba/__init__.py", line 29, in <module>
import samba.param
Which python version the arm64 version runs?
docker run -it --rm diegogslomp/samba:arm64 python --version
docker run -it --rm diegogslomp/samba:arm64 python2 --version
docker run -it --rm diegogslomp/samba:arm64 python3 --version
Maybe I need to change the script to python3 samba-tool
instead samba-tool
So... I haven't had any success running arm64 images on amd64, docker run --platform linux/arm64 samba:arm64 cmd
just gives me exec errors for every command, even an official arm64 image gives me errors, or I'm doing something wrong, or it just doesn't work. I'll update if I can get this to work.
Arm64 version built with docker buildx build --platform linux/arm64
and tested with docker run --platform linux/arm64
. Now should work on pi.
I am so sorry, i had no time and kinda forget about it, tried the latest image but still
Edit: i see ldb is not in the Dockerfiles
I tried to compile it, took pretty long but now i have this
Traceback (most recent call last):
File "/usr/local/samba/bin/samba-tool", line 34, in <module>
from samba.netcmd.main import samba_tool
File "/usr/local/samba/lib64/python3.9/site-packages/samba/__init__.py", line 29, in <module>
import samba.param
ModuleNotFoundError: No module named 'samba.param'
Hello
Today I built the 4.18.3 version without problems. I use the build script to do that.
In my case I build it on a amd64 debian pc, so first I check if can build arm64:
docker buildx ls | grep arm64
If not, I enable arm64:
docker run --privileged --rm tonistiigi/binfmt --install all
Check again:
docker buildx ls | grep arm64
Then build:
docker buildx build \
--platform linux/arm64 \
-f dockerfiles/almalinux \
--load --no-cache --tag samba:arm64 .
You can use the dockerhub image built today too.
When I had similar problems it was related to the wrong amd/arm image used by the buildx command.
Building is not the problem, the problem occurs when trying to run the container, also with 4.18.3
I tried changing the dockerfile and added python3-ldb and after that i got the second error i sended you when running the container
Same issue as here: https://github.com/diegogslomp/samba-ad-dc/issues/10#issuecomment-1464936832 Your suggestion: https://github.com/diegogslomp/samba-ad-dc/issues/10#issuecomment-1465976296
In the sbin folder i changed samba-tool
to python3 samba-tool
building and testing now
To run an arm64 image on a amd64 pc I need t o add the --platform
option to the docker run command like this:
docker run -d --privileged \
--restart=unless-stopped \
--network=host \
--platform linux/arm64 \
-e REALM='DGS.NET' \
-e DOMAIN='DGS' \
-e ADMIN_PASS='Passw0rd' \
-e DNS_FORWARDER='8.8.8.8' \
-v dc1-samba:/usr/local/samba \
--name dc1 --hostname DC1 samba:arm64
What i the output of the command below:
docker run -it --rm --platform linux/arm64 samba:arm64 uname -r
Did you read my reply? also i am on arm64 and build and using it on arm64 in this case
The time I had similar problems I was trying to compile/run the image in a wrong architecture, it seems the problem is with python packages but it was only build/buildx problems, even if you add the packages that are "missing" you will get other errors, the current dockerfile has been tested and runs without problems.
So before build the architecture linux/arm64
should be printed with docker buildx ls
, build it with docker buildx --platform linux/arm64
and run it with docker run --platform linux/arm64
Run and print here the results of the commands:
uname -r
docker buildx ls
Try using the diegogslomp/samba-ad-dc:arm64
not the compiled samba:arm64
to run the container and print results too.
Here are my output for reference:
~/repos/samba-ad-dc (master) docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
default * docker
default default running v0.11.7-0.20230525183624-798ad6b0ce9f linux/amd64, linux/amd64/v2, linux/386, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
~/repos/samba-ad-dc (master) docker run -it --platform linux/arm64 --rm samba:arm64 uname -m
aarch64
~/repos/samba-ad-dc (master) docker run -it --rm samba:almalinux uname -m
x86_64
~/repos/samba-ad-dc (master) uname -m
x86_64
Your output of the uname -r
is empty, how about the uname -m
or uname
output?
So the aarch64 matches the image version and when you pull it from dockerhub it should bring the right one. You said that you can build the image without problems too, but using the compiled one shows the same errors.
Can you at least print the samba version from your compiled one?
docker run -it --rm samba:arm64 samba --version
At home I'll try to compile and run it from a windows, using same scripts that I run it on linux, since I don't have an arm64 to test it.
Version 4.18.3
Hello
I uploaded the arm64 image compiled using a Windows environment, please test it in your pi, lets see if the output changes.
sadly enough it did not
Hello
I compiled a 4.17.8 version for diegogslomp/samba-ad-dc:arm64
, please check if this one shows same errors
Pulled the new image but still the same, i really think the image would need a modification to work on arm
Any thoughts? it is running python3
Seems like something with the env variable for samba, but i am stuck now, giving up for now
Here's my output using windows environment:
PS C:\Users\diego> docker run -d --privileged --restart=unless-stopped --network=host --platform linux/arm64 -e REALM='DGS.NET' -e DOMAIN='DGS' -e ADMIN_PASS='Passw0rd' -e DNS_FORWARDER='8.8.8.8' -v dc1-samba:/usr/local/samba --name dc1 --hostname DC1 diegogslomp/samba-ad-dc:arm64
PS C:\Users\diego> docker exec -it dc1 uname -m
aarch64
PS C:\Users\diego> docker exec -it dc1 python3 --version
Python 3.9.16
PS C:\Users\diego> docker exec -it dc1 samba-tool
Usage: samba-tool <subcommand>
Main samba administration tool.
Options:
-h, --help show this help message and exit
Version Options:
-V, --version Display version number
Available subcommands:
computer - Computer management.
contact - Contact management.
dbcheck - Check local AD database for errors.
delegation - Delegation management.
dns - Domain Name Service (DNS) management.
domain - Domain management.
drs - Directory Replication Services (DRS) management.
dsacl - DS ACLs manipulation.
forest - Forest management.
fsmo - Flexible Single Master Operations (FSMO) roles management.
gpo - Group Policy Object (GPO) management.
group - Group management.
ldapcmp - Compare two ldap databases.
ntacl - NT ACLs manipulation.
ou - Organizational Units (OU) management.
processes - List processes (to aid debugging on systems without setproctitle).
rodc - Read-Only Domain Controller (RODC) management.
schema - Schema querying and management.
sites - Sites management.
spn - Service Principal Name (SPN) management.
testparm - Syntax check the configuration file.
time - Retrieve the time on a server.
user - User management.
visualize - Produces graphical representations of Samba network state.
For more help on a specific subcommand, please type: samba-tool <subcommand> (-h|--help)
I tested this with Almalinux, Rockylinux, Debian and Ubuntu, the main image from dockerhub is in Almalinux, I can upload another os to see if changes.
Could try, but it is wierd that running it as arm64 goes completly fine for you but not for me
So I compiled with linux/arm64/v8
as image tag and linux/arm64
as buildx platform, since the images from dockerhub use version in tag but buildx does not, please check the new diegogslomp/samba-ad-dc:arm64
and see if the result changes.
Same result, but why do you not add ldb like it mentions?
Ldb packages installed on the new arm64 image:
[root@DC1 sbin]# yum list installed | grep ldb
libldb.aarch64 2.6.1-1.el9 @baseos
python3-ldb.aarch64 2.6.1-1.el9 @baseos
Now this error,
Wierd because docker run -it --rm diegogslomp/samba-ad-dc:arm64 samba-tool
does work
Maybe there is something wrong with the path
Please try remove the old volume before run it:
docker volume rm dc1-samba
I just don't understand why I can't reproduce this bug here, if the problem was PATH I should have problems too.
That fixed the issue great! no success with joining yet, does this docker version need port 53?
Nice! Now you need to change the nameserver editing /etc/resolv.conf and add the dc1 to the /etc/hosts from your host machine. More info here.
Example /etc/resolv.conf:
search samdom.example.com
nameserver 10.99.0.1
Example /etc/hosts:
127.0.0.1 localhost
10.99.0.1 DC1.samdom.example.com DC1
Do i need to change dns forwarder to something else?
No need, but you can use any dns you want, add more than one too, but the dns from your host should be the host ip address
It would be cool if there would also be an arm64 version so i can run it on my pi