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

bonjour ? #103

Open
PangciPG opened this issue Dec 18, 2023 · 1 comment
Open

bonjour ? #103

PangciPG opened this issue Dec 18, 2023 · 1 comment

Comments

@PangciPG
Copy link

Description

Thank You for the Sharing!
I made it on my host!
But I can not find the samba server from the network on my MacBook, MAYBE a bonjour service is required?

@krbob
Copy link

krbob commented Dec 12, 2024

You can easily add it by creating your own Dockerfile and modifying the base image:

FROM crazymax/samba:latest

RUN apk add --no-cache avahi \
 && sed -i 's/^#*enable-dbus=.*/enable-dbus=no/' /etc/avahi/avahi-daemon.conf \
 && mkdir -p /etc/services.d/avahi \
 && { \
    echo '#!/usr/bin/execlineb -P'; \
    echo 'with-contenv'; \
    echo 'avahi-daemon --no-drop-root --no-chroot'; \
   } > /etc/services.d/avahi/run \
 && chmod +x /etc/services.d/avahi/run \
 && mkdir -p /etc/avahi/services \
 && { \
    echo '<?xml version="1.0" standalone="no"?>'; \
    echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">'; \
    echo '<service-group>'; \
    echo '    <name replace-wildcards="yes">%h</name>'; \
    echo '    <service>'; \
    echo '        <type>_smb._tcp</type>'; \
    echo '        <port>445</port>'; \
    echo '    </service>'; \
    echo '</service-group>'; \
   } > /etc/avahi/services/samba.service

Then simply replace image: crazymax/samba:latest with

build:
    context: .
    dockerfile: Dockerfile

in your compose.yml.

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