2020年5月20日水曜日

Beanstalk for S3のマウント方法について(by Docker)

Beanstalkにて、コンテナ作成時にS3のマウント方法について
以下、記載します。
1)goopysのインストールを行うと、以下のエラーが表示されてマウントできない。

yum install golang fuse git -y
---------------------------------------------------
export GOPATH=$HOME/go
go get github.com/kahing/goofys
go install github.com/kahing/goofys
mkdir /mnt/mnt-goofys
/root/go/bin/goofys test23 /mnt/mnt-goofys
-----------------------------------------------------

エラー内容:
Feb 16 02:14:32 4d35e2afd964 /root/go/bin/goofys12390: s3.INFO Switching from region 'us-east-1' to 'ap-northeast-1'
Feb 16 02:14:32 4d35e2afd964 /root/go/bin/goofys12390: main.FATAL Mounting file system: Mount: mount: running fusermount: exit status 1#012#012stderr:#012fusermount: fuse device not found, try 'modprobe fuse' first#012
原因:docker特有の権限の問題でマウントが出来ないので、docker実行時のオプションで --privilegedを加えてあげる必要がある。


2)ebextensions内に追加する。

vi .ebextensions/00.docker.config
------------------------------------------------------
commands:
  01_privileged:
    command: 'sed -i "s/docker run -d/docker run --privileged -d/" /opt/elasticbeanstalk/hooks/appdeploy/enact/00run.sh'
------------------------------------------------------

0 件のコメント:

コメントを投稿

Launchdによる「自律起動」――Macを開けば、そこにAIがいる

  【OS起動時の「透明な」自動化】 コマンドを叩いてサーバーを立てるのも一興だが、真の「達成感」は、Macを立ち上げた瞬間にすべての環境が整っている「透明な自動化」にある。 macOS標準のサービス管理システム  launchd  を使い、ログインした瞬間に M1 Max(リモ...