Last active
August 29, 2015 14:14
-
-
Save tkdn/3403d7635277696abd03 to your computer and use it in GitHub Desktop.
boot2dockerで初心者がつまずいたこと(マウント関係とか) ref: http://qiita.com/tkdn/items/6a539b85ced755fd386e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 # 変わらない |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUN chmod -R www-data /var/www/html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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