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

Docker Volume with Azure Storage #7

Open
RongTsai4Git opened this issue Jan 28, 2022 · 1 comment
Open

Docker Volume with Azure Storage #7

RongTsai4Git opened this issue Jan 28, 2022 · 1 comment

Comments

@RongTsai4Git
Copy link
Owner

RongTsai4Git commented Jan 28, 2022

Reference

目的想要讓 docker container 去掛載在 azure storage 上的資料夾做為volume
需要藉由 azure file docker plugin 來實現
下面是實際操作的指令:

git clone https://github.com/Azure/azurefile-dockervolumedriver src/azurefile
cd src/azurefile/
go mod
go mod tidy
go mod vendor
go build
sudo ./azurefile --account-name {storage_account_name} --account-key {storage_account_key}&
sudo docker volume create -d azurefile -o share={myvol} --name {vol}
sudo docker volume ls
@RongTsai4Git
Copy link
Owner Author

RongTsai4Git commented Feb 17, 2022

using systemd init system (Ubuntu 15.04 or higher)

user$ sudo -s
user# cp {azurefile}/contrib/init/systemd/azurefile-dockervolumedriver.default /etc/default/azurefile-dockervolumedriver
user# cp {azurefile}/contrib/init/systemd/azurefile-dockervolumedriver.service /etc/systemd/system/azurefile-dockervolumedriver.service
user# systemctl daemon-reload
user# systemctl enable azurefile-dockervolumedriver
user# systemctl start azurefile-dockervolumedriver

# Check status
user$ systemctl status azurefile-dockervolumedriver

To test

user$ docker volume create -d azurefile --name myvol -o share=myvol
user$ docker run -i -t -v myvol:/data busybox
user# cd /data
user# touch a.txt

You can find the logs at journalctl -fu azurefile-dockervolumedriver

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

1 participant