Public Repository

Last pushed: 2 years ago
Short Description
Provide a mount.cifs for CoreOS (for example)
Full Description

Build & Package mount.cifs with Dockerception

Provide a mount.cifs for CoreOS (for example) to use, optimized for size.

mount.cifs homepage

more tips on using mount.cifs with docker

this image is a fork from sigma/mount.cifs_copy

Delivering mount.cifs to a docker host:

docker run -it --rm -v /opt/bin/:/target so0k/mount.cifs_copy /target

Source on github

Usage running CoreOS on Hyper-V:

Hyper-V does not provide guest additions as used by vagrant/boot2docker, however if a mount.cifs binary is dropped into the CoreOS VM (i.e. in /opt/bin/) - similar transparency can be obtained:

demo (from a windows host, using CoreOS VM as docker_host):

PoC "installation" script:

Expects windows host is sharing folder as prj, windows host ip = 10.40.0.1 and mounts this as /mnt/win/.

#!/bin/bash

SMB_HOST=${SMB_HOST:-192.168.57.1}
SMB_SHARE=${SMB_SHARE:-share}
SMB_USER=${SMB_USER:-user}
WIN_MOUNT=${WIN_MOUNT:-/mnt/win}

#/opt/bin will automatically be created and is included in $PATH
#docker run --rm -v /opt/bin:/target so0k/mount.cifs-copy:6.4 /target

read -s -p "Password: " SMB_PASS
printf "\n"
printf "mounting drive to $WIN_MOUNT\n"
sudo /opt/bin/mount.cifs //$SMB_HOST/$SMB_SHARE $WIN_MOUNT -o nolock,username=$SMB_USER,pass=$SMB_PASS,iocharset=utf8

Mount on boot:

a unit file could be created to map samba shares on start up.
(I have not tested this unit file - comment please for corrections)

[Unit]
Description=Mount Share service
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=0
#ExecStartPre=/usr/bin/docker run --rm -v /opt/bin:/target so0k/mount.cifs_copy:6.4 /target
ExecStart=/opt/bin/mount.cifs //10.40.0.1/prj /mnt/win -o user=vincent,pass=password,uid=0,gid=0

ref:

Docker Pull Command
Owner
so0k

Comments (5)
so0k
a year ago

cifs-utils 6.5 was released february 2016 and I will build new tag for it, but I wonder about http://badlock.org/ ... seems cifs-utils do not require a patch for this?

so0k
2 years ago

@csatfjpacheco - thx for pointing that out :o

csatfjpacheco
2 years ago

Typo in unit file: so0k/mount.cifs_copy:6.4

so0k
2 years ago

@rochapabloricardo - the issue you refer to on stakoverflow uses KiteMatic with Docker Machine. Docker Machine uses boot2docker ISO which is a modified Tiny Core Linux (TLC). I think there are packages you can use with boot2docker to mount shares from your windows host, if you are not using VirtualBox guest services to mount drives into your docker machine... I personally prefer not to work with TLC and I am using Hyper-V instead of VirtualBox. In short, Yes, this image can help you fix the issue you face, but only if you want to go the long way and learn to do a few things manually.

rochapabloricardo
2 years ago