Here’s my updated method for building a Samba container that runs on arm/arm64 (tested on CCR2116, CCR2004, RB5009, which are all arm64).
Below is the Dockerfile from the perviously linked repo (as of this writing). Obviously check the copy you clone first to verify you’re comfortable with the RUN, COPY, and CMD statements.
FROM alpine:3.12.0
RUN apk add --no-cache --update \
samba-common-tools \
samba-client \
samba-server
COPY smb.conf /etc/samba/smb.conf
EXPOSE 139/tcp 445/tcp
CMD ["smbd", "--foreground", "--log-stdout", "--no-process-group"]
In essence, it loads the stock Alpine Linux image, instructs it to install the Samba packages, copies a stripped-down smb.conf file, and executes the smb daemon when the container starts.
Certainly you could modify the Dockerfile if you want your image to have more to it, such as a text editor (other than ‘vi’) for manipulating the config. I changed the Alpine linux image label to “latest”, and learned the newer version of Samba that is loaded doesn’t supports the CMD line flag “–log-stdout”, so you’ll have to remove that flag if you make similar changes.
My container instructions maps /etc/samba to disk, so that any changes I make to smb.conf persist across container deployments, as opposed to using the simple one included in this guy’s repo.
Run this on your container-creating computer:
$ git clone https://github.com/fschuindt/docker-smb
$ cd docker-smb
# Make any desired changes to Dockerfile and smb.conf
$ docker buildx build -t samba-arm --platform=linux/arm/v7 . # for 32-bit ARM targets, built on any PC/Mac hosts
$ docker save samba-arm > samba-arm.tar
$ docker buildx build -t samba-arm64 --platform=linux/arm64 . # for 64-bit ARM targets, built on non-M1/M2 hosts
$ docker build -t samba-arm64 --platform=linux/arm64 . # for 64-bit ARM targets built on M1/M2 (the buildx example above works too, honestly)
$ docker save samba-arm64 > samba-arm64.tar
# Copy to your ARM router, like a hAP AC2/AC3
$ scp samba-arm hAPac3:/path/to/disk/
# Copy to your ARM64 router, like CCR2216, CCR2116, CCR2004, RB5009
$ scp samba-arm64 ccrARM64:/path/to/disk/
I inadvertently copied the samba-arm.tar (arm/v7) file to my CCR2004 and RB5009 (both arm64). While they worked just fine, I realized my mistake and copied the arm64 versions over and replaced the container. I saw slight performance improvements in both throughput and CPU, enough to make it worth the effort of matching the platform more accurately.
Container setup on router (revised version):
# Configure your veth1 however you like; mine is successfully bridged to the router's main bridge, putting the container in the same LAN as the other hosts.
# This alleviates the need for NAT to the container
#
/container mounts
add dst=/etc/samba/ name=samba-etc src=/disk1/samba-etc
add dst=/Shared/ name=samba-share src=/disk1/samba-share
/container config
set registry-url=https://registry-1.docker.io tmpdir=disk1/docker-pull
/container envs
add key=TZ name=samba value=America/Denver
/container
# My USB/NVMe disks are labeled "disk1"
add envlist=samba interface=veth1 logging=yes mounts=samba-etc,samba-share root-dir=disk1/samba-root start-on-boot=yes file=disk1/samba-arm64.tar
# Assuming this is the first container
start 0
Thank you @tangent and others for your help. Now I’ve got a decent sandbox to play with.