Skip to content

Instantly share code, notes, and snippets.

@tkdn
Last active August 29, 2015 14:14
Show Gist options
  • Save tkdn/3403d7635277696abd03 to your computer and use it in GitHub Desktop.
Save tkdn/3403d7635277696abd03 to your computer and use it in GitHub Desktop.
boot2dockerで初心者がつまずいたこと(マウント関係とか) ref: http://qiita.com/tkdn/items/6a539b85ced755fd386e
$ docker run -d -p 80:80 \
-v /c/Users/yourname/projects/repo/html:/var/www/html \ # マウントオプションでホストとの共有ディレクトリを指定
--name apache darekano/apache
$ docker exec -it apache bash # コンテナの中に入る
root@7eaf997110d8:/# cd /var/www/html # くどいけど、コンテナの中のここはホスト=ゲストの共有ディレクトリ
root@7eaf997110d8:/var/www/html# ls -al
total 2
drwxrwxrwx 1 1000 staff 4096 Feb 1 13:29 .
drwxr-xr-x 4 root root 4096 Feb 1 13:28 ..
-rwxrwxrwx 1 1000 staff 5667 Nov 5 09:08 .htaccess
-rwxrwxrwx 1 1000 staff 2642 Nov 5 09:06 index.html # ownerがこのようになってる
root@7eaf997110d8:/var/www/html# chown -R www-data /var/www/html # としたところで
root@7eaf997110d8:/var/www/html# ls -al
drwxrwxrwx 1 1000 staff 4096 Feb 1 13:29 .
drwxr-xr-x 4 root root 4096 Feb 1 13:28 ..
-rwxrwxrwx 1 1000 staff 5667 Nov 5 09:08 .htaccess # 変わらない
RUN chmod -R www-data /var/www/html
$ docker run -d -p 80:80 \
-v /c/Users/yourname/projects/repo/html:/var/www/html \ # マウントオプションでホストとの共有ディレクトリを指定
--name apache darekano/apache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment