์ด ์ค๋ฅ๋ ๋ ์ปดํจํฐ์์ ๊ฑฐ์ ๋์์ docker-compose ์ฌ์ฉํ๊ณ ์ต๊ทผ์๋ ๋กค๋ฐฑ ํ fig์์ ๋ฐ์ํ์ต๋๋ค. ๋ช ๊ฐ์ง ๊ฒ์ ๊ฒฐ๊ณผ๊ฐ python / openssl ๋ฌธ์ ๋ฅผ ๊ฐ๋ฆฌ ํค์ง ๋ง ์ด๋๋ก ํ์ผํ ์ง ๊ฐ๋จํ๊ฒ ์ ์ ์์ต๋๋ค. Python / openssl์ homebrew์์ ์ ๊ณต๋ฉ๋๋ค.
Boot2Docker-cli ๋ฒ์ : v1.4.1
ํ๋ด ์ปค๋ฐ : 43241cb
ํด๋ผ์ด์ธํธ ๋ฒ์ : 1.4.1
ํด๋ผ์ด์ธํธ API ๋ฒ์ : 1.16
Go ๋ฒ์ (ํด๋ผ์ด์ธํธ) : go1.4
Git ์ปค๋ฐ (ํด๋ผ์ด์ธํธ) : 5bc2ff8
OS / Arch (ํด๋ผ์ด์ธํธ) : darwin / amd64
์๋ฒ ๋ฒ์ : 1.4.1
์๋ฒ API ๋ฒ์ : 1.16
Go ๋ฒ์ (์๋ฒ) : go1.3.3
Git ์ปค๋ฐ (์๋ฒ) : 5bc2ff8
docker-compose
๋ฆด๋ฆฌ์ค ํ๋ณด๋ฅผ ์ฌ์ฉํ๋ ค๊ณ ํด๋ ๋๊ฐ์ ์ผ์ด ๋ฐ์ํ๋ค๊ณ ์๊ฐํฉ๋๋ค ...
$ docker-compose ps
SSL error: hostname '192.168.59.103' doesn't match 'boot2docker'
ํ์ง๋ง fig
์ ์๋ํฉ๋๋ค ...
$ fig -f docker-compose.yml ps
Name Command State Ports
------------------------------
์ ๋ OSX์์ @gkostyanikov ์ ๋์ผํ ๋ฒ์ ์ ์คํํ๊ณ ์์ต๋๋ค. ๋จ, Go ํด๋ผ์ด์ธํธ ๋ฒ์ ์ go1.3.3
์
๋๋ค. ๋ด python / openssl๋ Homebrew๋ฅผ ํตํด ์ค์น๋ฉ๋๋ค. ๊ทธ๊ฒ๊ณผ ๊ด๋ จ์ด ์์ต๋๊น?
ํธ์ง : ์ค์ ๋ก Homebrew๊ฐ openssl์ ์ฐ๊ฒฐํ์ง ์๋ ๊ฒ์ฒ๋ผ ๋ณด์ด๋ฏ๋ก ๊ธฐ๋ณธ OSX ๋ฒ์ ์ธ OpenSSL 0.9.8za 5 Jun 2014
์์ต๋๋ค.
๋ฌธ์ ๋ Homebrew python์ด์์ต๋๋ค.
docker-compose
์ง๊ธ์ ์ค์น, ์ฌ์ ํ์ด์ฌ / OpenSSL์ ์ ๊ฑฐํ ํ ์๋ pip
๊ฐ์ง easy_install
, ๊ทธ๋ฆฌ๊ณ ๋ค์ ์ค์น docker-composer
์์คํ
ํ์ด์ฌ์ ์ฌ์ฉ.
@adambiggs ์๋ฃจ์ ์ด ์๋ํฉ๋๋ค! ๊ฐ์ฌ!
์ด๊ฒ์ ๋์๊ฒ๋ ํจ๊ณผ๊ฐ ์์๊ณ ์๋ก์ด Mac์ ์ฌ์ฉํ๊ณ ํ๋ธ๋ฅ ํ์ด์ฌ์ผ๋ก ์ค์ ํ์ต๋๋ค. ๋์ปค์ ํต์ ํ๋ ๋ฌดํ๊ณผ ์์์ด ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค. @adambiggs์ ์กฐ์ธ์ ๊ทธ๋๋ก
์ด๊ฒ์ ๋์๊ฒ๋ ์ผ์ด๋๊ณ ์์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ ์์คํ ์ ํ์ด์ฌ์ ์ฌ์ฉํ๊ณ ์ถ์ง ์์ต๋๋ค. ๋๊ตฌ๋ ์ง ๋ค๋ฅธ ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ์์ต๋๊น?
๋ฐ์ด๋๋ฆฌ๋ฅผ ์ฌ์ฉํด ๋ณด์ จ์ต๋๊น? ๊ฐ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๊น?
์๋ ๋ฐ์ด๋๋ฆฌ๋ฅผ ์๋ํ์ง ์์์ต๋๋ค.
์์คํ
ํ์ด์ฌ์ ์ค์นํ์ง ์์ผ๋ ค๋ฉด ๋ ๋ค๋ฅธ ํด๊ฒฐ ๋ฐฉ๋ฒ์ virtualenv (wrapper)๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์
๋๋ค.
mkvirtualenv --python=/usr/bin/python docker-compose
pip install docker-compose==1.1.0-rc2
pyenv
๋ฅผ ์ฌ์ฉํ์ฌ Python 2.7.8๋ก ๋กค๋ฐฑํ๋ ๋ ๋์ ์๋ฃจ์
์ ์ฐพ์์ต๋๋ค.
http://stackoverflow.com/a/28216459/1166293
https://github.com/yyuu/pyenv
ํธ์ง : ์ ๊ฒฝ ์ฐ์ง ๋ง์ธ์, pyenv
์์ฒด ๋ฌธ์ ๊ฐ ๋ง์ด ๋ฐ์ํ์ต๋๋ค ...
์ด ์ค๋ฅ์ ์์ธ์ home-brew openssl์ด / usr / local / bin / openssl์ ์ฐ๊ฒฐ๋์ง ์์๊ธฐ ๋๋ฌธ์ ๋๋ค.
openssl version
OpenSSL 0.9.8zc ๋ฐํ OpenSSL 1.0.1j๊ฐ ์๋
๋ฌ๋ฆฌ๋
brew link --force openssl
fig๋ฅผ ๋ค์ ์ค์นํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค.
ํฅ๋ฏธ๋กญ์ง ๋ง ์ OpenSSL ๋ฒ์ ์
@aanand ์ ๊ฒฝ์ฐ์๋ ๋ฐ์ด๋๋ฆฌ ์์ด ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
๋๋ homebrew๊ฐ ์๋ โโpip๋ฅผ ํตํด fig๋ฅผ ์ค์นํ์ ๋์ด ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค. sudo pip uninstall fig
๋ฐ brew install fig
๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
@NotBobTheBuilder ์๋ฃจ์ ์ ๊ฒฝ์ฐ +1, ์ ์๊ฒ๋
: +1 : @NotBobTheBuilder ์ฉ
@NotBobTheBuilder ๋ฌดํ๊ณผ์ ๋ํ ์ข์ ์๋ฃจ์ ์ด์ง๋ง ๋ถํํ๋ ๋์ปค ์์ฑ์ homebrew์์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
@ocasta OpenSSL ์ฐ๊ฒฐ์ ๋ํ homebrew์ ๋ฌด์์ด ๊ฒฝ๊ณ ๋ ์ด๋ป์ต๋๊น?
์ด ๊ณต์์ ํต ์ ์ฉ์ ๋๋ค.
Mac OS X์ ์ด๋ฏธ์ด ์ํํธ์จ์ด๋ฅผ ์ ๊ณตํ๋ฉฐ ๋ค๋ฅธ ๋ฒ์ ์
๋ณ๋ ฌ์ ๋ชจ๋ ์ข ๋ฅ์ ๋ฌธ์ ๋ฅผ ์ผ์ผํฌ ์ ์์ต๋๋ค.Apple์ ์์ฒด TLS ๋ฐ ์ํธํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ํด OpenSSL ์ฌ์ฉ์ ์ค๋จํ์ต๋๋ค.
@NotBobTheBuilder ์์ง
๋๊ตฌ๋ ์ง์ด ๋ฌธ์ ์ ์์ธ์ ์๊ณ ์์ต๋๊น? ๊ทธ๊ฒ์ ๋ฌดํ๊ณผ์ ํจ๊ป ๋์๊ฒ ์ผ์ด๋๊ณ ์์ต๋๋ค. ๋๋ ์ง๊ธ์ฒ๋ผ pip install fig
๋ฅผ ๊ณ ์ํ๋ ๊ฒ์ ์ ํธํฉ๋๋ค. ๋ช ์ฃผ ์ ์๋ ๋ชจ๋ ์ ์๋ํ์ต๋๋ค. ๋ด ์์คํ
์์ ๋ฌด์์ด ๋ณ๊ฒฝ๋์๋์ง ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.
๋ด ์์คํ
OpenSSL์ OpenSSL 0.9.8zc 15 Oct 2014
์ด๊ณ ๋ด homebrew openssl์ ๋ ์๋กญ์ง ๋ง ์ฐ๊ฒฐ๋์ง ์์์ต๋๋ค.
... Python 2.7.9๋ก ์
๊ทธ๋ ์ด๋ํ์ ๋ ๊ณ ์ฅ๋ ๊ฒ ๊ฐ์ต๋๋ค. SSL ๊ด๋ จ ๋ฒ๊ทธ๊ฐ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ค์๊ณผ ๊ฐ์ด ๋ณด์
๋๋ค.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196431
http://bugs.python.org/issue23052
brew link --force openssl
ํ๊ณ fig๋ฅผ ๋ค์ ์ค์นํด๋ ์๋ฌด๋ฐ ํจ๊ณผ๊ฐ ์์ต๋๋ค.
Py 2.7.9์ SSL ๋ณ๊ฒฝ ์ฌํญ์ ํด๊ฒฐํ๋ ค๋ฉด fig๋ฅผ ์
๋ฐ์ดํธํด์ผํฉ๋๊น?
https://www.python.org/dev/peps/pep-0476/#opting -out
boot2docker๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค. ๋ฐฉ๊ธ 1.5.0์ผ๋ก ์ ๊ทธ๋ ์ด๋ํ์ง๋ง ๋ณ๊ฒฝ ์ฌํญ์ด ์์ต๋๋ค.
In [1]: from fig.cli.docker_client import docker_client
In [2]: client = docker_client()
In [3]: client.version()
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
In [4]: %debug
> /Users/anentropic/.virtualenvs/dpm/lib/python2.7/site-packages/requests/sessions.py(461)request()
460 send_kwargs.update(settings)
--> 461 resp = self.send(prep, **send_kwargs)
462
ipdb> p settings
{'verify': '/Users/anentropic/.boot2docker/certs/boot2docker-vm/ca.pem', 'cert': ('/Users/anentropic/.boot2docker/certs/boot2docker-vm/cert.pem', '/Users/anentropic/.boot2docker/certs/boot2docker-vm/key.pem'), 'proxies': {}, 'stream': False}
๋ฌดํ๊ณผ ์ฝ๋๊ฐ ์ ํ ํด ๋ณด์ ๋๋ค. boot2docker๊ฐ ์ค์น ํ ์ธ์ฆ์๋ฅผ ์ฌ์ฉํ๋ ค๊ณ ํฉ๋๋ค ...์ด ์ธ์ฆ์๋ ํญ์ ์๋ํ๊ธฐ ๋๋ฌธ์ ๊ด์ฐฎ๋ค๊ณ ๊ฐ์ ํ๊ณ ๋ง๋ฃ๋์ง ์์์ผํ๋ฏ๋ก b2d๋ฅผ ์ ๊ทธ๋ ์ด๋ํ์ต๋๋ค.
์, ๋ด Python (homebrew๋ฅผ ํตํด ์ค์น๋จ)์ OpenSSL์ homebrew ๋ฒ์ ์ ์ฌ์ฉํ๋ ๊ฒ ๊ฐ์ต๋๋ค.
$ python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.0.2 22 Jan 2015
$ brew info openssl
openssl: stable 1.0.2 (bottled)
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
... /usr/local/opt/openssl/bin/c_rehash
์ ๋์์ด๋์ง ์์์ต๋๋ค. :)
๋์ผํ ๋ฌธ์ ๋ก $ brew switch python 2.7.8_2
๋ฅผ ํตํด ์ด์ ์ ์ค์น๋ Python ๋ฒ์ (2.7.8_2)์ ์๋ํ์ต๋๋ค (์ค๋ฅ ๋ฉ์์ง๊ฐ ์ฝ๊ฐ ๋ค๋ฅด๋๋ผ๋). ๋ฐ๋ผ์ ํ์ด์ฌ 2.7.9 ๋ฒ์ ์ ๋ฌธ์ ๊ฐ ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
๊ทธ๋ฐ ๋ค์ 1.0.2์์ 1.0.1j_1๋ก ์ด์ openssl ๋ฒ์ ์ผ๋ก ์ ํํ๋ ค๊ณ ์๋ํ์ต๋๋ค.
$ python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.0.2 22 Jan 2015
$ docker-compose ps
SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
$ brew switch openssl 1.0.1j_1
$ python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.0.1j 15 Oct 2014
$ docker-compose ps
Name Command State Ports
------------------------------
๋์๊ฒ๋ ๋ค๋ฅธ ์ค๋ฅ๊ฐ ํ์๋์ง๋ง ์๋ชป๋ ๋ด์ฉ์ ์ขํ๋ ๋ฐ ๋์์ด ๋ ์ ์์ต๋๋ค.
$ brew switch openssl 1.0.1j_1
Error: openssl does not have a version "1.0.1j_1" in the Cellar.
Versions available: 1.0.1e, 1.0.1f, 1.0.1g, 1.0.2
$ brew switch openssl 1.0.1g
Opt link created for /usr/local/Cellar/openssl/1.0.1g
$ fig up
SSL error: hostname '192.168.59.103' doesn't match 'boot2docker'
OpenSSL 1.0.2๋ก ๋ค์ ์ ํํ๋ฉด ์ด์ CERTIFICATE_VERIFY_FAILED
์ค๋ฅ๊ฐ ๋ฐ์ํ๋ฏ๋ก ๋ฒ์ ์ ๋ณ๊ฒฝํ๋ฉด ํ์คํ ํจ๊ณผ๊ฐ ์์ต๋๋ค.
ํ ๊ฐ์ง ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ปจํ ์ด๋์์ docker-compose๋ฅผ ์คํํ๋ ๊ฒ์ ๋๋ค.
git clone [email protected]:docker/fig.git
cd fig
docker build --tag docker-compose .
alias docker-compose='docker run --rm -e "DOCKER_TLS_VERIFY=$DOCKER_TLS_VERIFY" -e DOCKER_HOST=tcp://172.17.42.1:2376 -e DOCKER_CERT_PATH=/usr/local/certs -v "$DOCKER_CERT_PATH:/usr/local/certs" -v "$PWD:/code" docker-compose --project-name "${PWD##*/}"'
์ด๋ฅผ ์ํด์๋ VirtualBox์์ ํฌํธ 2376์ ๋ ธ์ถํด์ผํฉ๋๋ค.
VBoxManage controlvm boot2docker-vm natpf1 "docker-s,tcp,127.0.0.1,2376,,2376"
@kretz ์ ๋ต๋ณ์ด ์ ์๊ฒ
+1 @kretz ์ถ์ถ ์ค์์น openssl 1.0.1j_1
์์์๋ฅผ ๋ง๋ค์๋ค
์์กฐ ์ค์์น openssl 1.0.1j๊ฐ ์ ์๊ฒ ํจ๊ณผ์ ์ ๋๋ค (_1 ๋ถ์กฑ์ ์ ์ํ์ญ์์ค)
๋๋ ๊ทธ๊ฒ์ ์ข์ํ์ง ์์ง๋ง ๋ด virtualenv์์ fig๋ฅผ ์ ๊ฑฐํ๊ณ homebrew๋ฅผ ํตํด ์ค์นํ์ฌ ๋๋ฅผ ์ํด ์์ ํ์ต๋๋ค.
@kretz ์๊ฒ ๊ฐ์ฌ
๋ค์๊ณผ ๊ฐ์ ์ด์ ๋ก ์๋ํ์ง ์์ต๋๋ค.
$ brew switch openssl 1.0.1j_1
Error: openssl does not have a version "1.0.1j_1" in the Cellar.
Versions available: 1.0.2
๋ด ํด๊ฒฐ ๋ฐฉ๋ฒ์ brew์์ ์ป์ 2.7.9๊ฐ ์๋ python 2.7.8๋ก virtualenv๋ฅผ ๋ง๋๋ ๊ฒ์ ๋๋ค.
๋ค์ํ ํด๊ฒฐ ๋ฐฉ๋ฒ ... ๋๊ตฌ๋ ์ค์ ๋ฌธ์ ์ ๋ํ ํต์ฐฐ๋ ฅ์ด ์์ต๋๊น?
App Engine์ ๋ฌด์๊ณผ ๊ด๋ จ์ด ์์ต๋๊น?
2015 ๋ 3 ์ 11 ์ผ 18:09์ Ryan Small [email protected] ์ ๋ค์๊ณผ ๊ฐ์ด ์ผ์ต๋๋ค.
๋๋ ํ์ด์ฌ 2.7.9์์ ์๋ํ๋ ์ฑ ์์ง์ด ์๋ค๊ณ ํ์ ํฉ๋๋ค.
โ
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.
https://github.com/docker/compose/issues/890#issuecomment -78329652.
@anentropic ์ด์ openssl ๋ฒ์ ์ ์ฌ์ฉ (์ ํ)ํ๋ ค๋ฉด ๋จผ์ ์ค์นํด์ผํฉ๋๋ค.
# Find available older versions to install
$ brew search openssl
openssl
homebrew/versions/openssl098 homebrew/versions/openssl101
# Install older 1.0.1 version
$ brew install homebrew/versions/openssl101
# See what versions are installed locally
$ brew info openssl
...
/usr/local/Cellar/openssl/1.0.1f (429 files, 15M)
Built from source
/usr/local/Cellar/openssl/1.0.1i (430 files, 15M)
Poured from bottle
/usr/local/Cellar/openssl/1.0.1j (431 files, 15M)
Poured from bottle
/usr/local/Cellar/openssl/1.0.1j_1 (431 files, 15M)
Poured from bottle
/usr/local/Cellar/openssl/1.0.2 (459 files, 18M)
Poured from bottle
...
# Switch to one of the 1.0.1 you got installed
$ brew switch openssl 1.0.1j_1
brew install openssl101
ํ์ง๋ง 1.0.1j
๋ก ์ ํ ํ ๊ฐ๋ฅ์ฑ์ด ์์์ต๋๋ค ... 1.0.1l
์คฌ๊ณ ์ดํ ์์คํ
์ด ํผ๋ ๋ ๊น๋ด ๊ฑฑ์ ํ์ต๋๋ค ๊ทธ๋ค์ ๋ณ๋์ ์์กฐ ํจํค์ง์ด๋ฉฐ ์ด๋ฏธ 1.0.2
์ ๋ณ๋ ฌ๋ก ๊ฐ์ง๊ณ ์์ต๋๋ค.
๋์์ด๋์ง ์๋ ๊ฒ ๊ฐ์์ง๋ง ์๋ง ๋๋ ๊ทธ๊ฒ์ผ๋ก ์ถฉ๋ถํ ๋ฉ๋ฆฌ ๊ฐ์ง ์์๋ค
์ฃ์กํฉ๋๋ค. ์๋ชป๋ github ๋ฌธ์ ์ ๋ต์ฅํ์ต๋๋ค (๋น ๋ฅด๊ฒ ๋ด ๋๊ธ ์ญ์ ).
2015 ๋
3 ์ 11 ์ผ ์์์ผ ์ค์ 11์ 30 ๋ถ anentropic [email protected]
์ผ๋ค :
๋๋ openssl101์ ์ค์นํ์ง๋ง ๊ฐ๋ฅ์ฑ์์ฃผ์ง ๋ชปํ์ต๋๋ค.
1.0.1j๋ก ์ ํํฉ๋๋ค. 1.0.1l๋ฅผ์คฌ๊ณ
๊ทธ๋ค์ ๋ณ๋์ ์์กฐ ํจํค์ง์ด๊ณ ์ด๋ฏธ ๊ฐ์ง๊ณ ์๊ธฐ ๋๋ฌธ์ ๋ด ์์คํ ์ ํผ๋
1.0.2 ๋ณ๋ ฌ๋์์ด๋์ง ์๋ ๊ฒ ๊ฐ์์ง๋ง ์๋ง ๋๋ ๊ทธ๊ฒ์ผ๋ก ์ถฉ๋ถํ ๋ฉ๋ฆฌ ๊ฐ์ง ์์๋ค
โ
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.
https://github.com/docker/compose/issues/890#issuecomment -78340580.
๊ทธ๋์ ๋๋์ด ๋ฌธ์ ๊ฐ Mac OSX์์ ์คํ๋๋ ๊ฒ ๊ฐ์ต๋๋ค. docker-compose๋ฅผ ์ฌ์ฉํ๋ฉด ์ด๊ฒ์ ๋ด .yml ํ์ผ์ ๋๋ค.
web:
build: .
links:
- db
- cache
- worker
ports:
- "8080:8080"
db:
image: mysql
cache:
image: redis
worker:
build: .
command: celery -A application.extentions worker -l info
docker-compose pull
์คํํ ๋ ์คํจํ ๋ค์ ์ถ๋ ฅ์ด ํ์๋ฉ๋๋ค.
$ docker-compose pull
Pulling db (mysql:latest)...
SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
๋ด๊ฐ ํ์ธํ ๋ช ๊ฐ์ง.
which openssl; openssl version
/usr/local/bin/openssl
OpenSSL 1.0.2 22 Jan 2015
brew๋ก ์ค์นํ๋ฉด @psykzz ๊ฐ ์๋ํฉ๋๋ค.
brew install docker-compose
@arvindtest ์ด ๋ฌธ์ ์ ๊ด๋ จ์ด ์๋ค๊ณ ์๊ฐํ๋ ์ด์ ๋ ๋ฌด์์ ๋๊น?
์ฐธ๊ณ ๋ก, ์ด๊ฒ์ผ๋ก ๋ง์ ์ด๋ ค์์ ๊ฒช์ ํ์ ์ด๊ฒ์ boot2docker ๋ฌธ์ ๋ก ๋ณด์
๋๋ค.
๋๋ฅผ ์ํด ์ผํ ๊ฒ์ TLS๋ฅผ ๋นํ์ฑํํ๋ ๊ฒ์ด ์์ต๋๋ค. ์ด ์์
์ ์ํํ๋ ์ฌ์ฉ์ ์นํ์ ์ธ ๋ฐฉ๋ฒ์ ์์ง ์์ง๋ง ์ง์นจ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
https://github.com/deis/deis/issues/2230
๊ธฐ๋ณธ์ ์ผ๋ก ๋ค์์ ์ํํด์ผํฉ๋๋ค.
boot2docker ssh
sudo echo 'DOCKER_TLS = no'> / var / lib / boot2docker / profile
๊ทธ๋ฐ ๋ค์ boot2docker๋ฅผ ๋ค์ ์์ํ์ญ์์ค.
boot2docker ์ค์ง
boot2docker ์์
~ / .bashrc์ ์ด์ ๋น์ทํ ๊ฒ (ip๊ฐ ์ฌ๋ฐ๋ฅธ์ง ํ์ธํ์ญ์์ค)
๋ด๋ณด๋ด๊ธฐ DOCKER_HOST = tcp : //192.168.59.103 : 2375
DOCKER_CERT_PATH ์ค์ ํด์
DOCKER_TLS_VERIFY ์ค์ ํด์
bashrc์์ $ (boot2docker shellinit)
๋ชจ๋ ๊ฒ์ ์ ๋๋ก ๋์์ผํฉ๋๊น?
์ฌ์ ํ TLS ์๋ฃจ์
์ ์ํํด์ผํฉ๋๋ค.
2015 ๋
3 ์ 21 ์ผ 23:05์ "coderfi" [email protected]์ด ์์ฑํ์ต๋๋ค.
์ฐธ๊ณ ๋ก, ์ด๊ฒ์ผ๋ก ๋ง์ ์ด๋ ค์์ ๊ฒช์ ํ์ ์ด๊ฒ์
boot2docker ๋ฌธ์ .
๋๋ฅผ ์ํด ์ผํ ๊ฒ์ TLS๋ฅผ ๋นํ์ฑํํ๋ ๊ฒ์ด ์์ต๋๋ค. ์์ง ์ฌ์ฉ์ ์นํ์ ์ธ ๋ฐฉ๋ฒ์ ์์ต๋๋ค
ํ์ง๋ง ์ฌ๊ธฐ์ ์ง์นจ์ด ์์ฝ๋์ด ์์ต๋๋ค.
deis / deis # 2230 https://github.com/deis/deis/issues/2230๊ธฐ๋ณธ์ ์ผ๋ก ๋ค์์ ์ํํด์ผํฉ๋๋ค.
boot2docker ssh
sudo echo 'DOCKER_TLS = no'> / var / lib / boot2docker / profile๊ทธ๋ฐ ๋ค์ boot2docker๋ฅผ ๋ค์ ์์ํ์ญ์์ค.
boot2docker ์ค์ง
boot2docker ์์~ / .bashrc์ ์ด์ ๊ฐ์ ๊ฒ
IP๊ฐ ์ ํํ์ง ํ์ธํ์ญ์์ค๋ด๋ณด๋ด๊ธฐ DOCKER_HOST = tcp : //192.168.59.103 : 2375
DOCKER_CERT_PATH ์ค์ ํด์
DOCKER_TLS_VERIFY ์ค์ ํด์ โ
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.
https://github.com/docker/compose/issues/890#issuecomment -84468058.
@kretz ์๋ํฉ๋๋ค! ๊ฐ์ฌ.
@psykzz $(boot2docker shellinit)
ํฉ๋๊น?
์, ๋ด ์๊ฒฌ์ ์ ๋ฐ์ดํธํ์ต๋๋ค. derp.
TLS๋ฅผ ๋นํ์ฑํํ๋ @coderfi ์ ์๋ฃจ์ ์ด ์ ์๊ฒ
๊ทธ๊ฒ์ ๋น์ ์ ์ํด ์๋ํฉ๋๋ค. :)
@Matt ์, ์ ์ด๊ธฐํ ์ ํ์ฅ ํ์ ๋ํด ๋ง์ต๋๋ค.
๊ทธ๋ฌ๋ boot2docker๊ฐ ์์ง ์์๋์ง ์์ ๊ฒฝ์ฐ ์๋ํ์ง ์์ ์ ์์ผ๋ฏ๋ก
์๋ฅผ ๋ช
์ ์ ์ผ๋ก ๋ง๋ค์์ต๋๋ค.
Fi
2015 ๋
3 ์ 26 ์ผ ์ค์ 10์ 18 ๋ถ์ "anentropic" [email protected]์ด ์์ฑํ์ต๋๋ค.
@coderfi https://github.com/coderfi ์ ์๋ฃจ์ ์ ํ์ธํ ์ ์์ต๋๋ค.
TLS ๋นํ์ฑํ๋ ๋๋ฅผ ์ํด ์๋ํฉ๋๋ค!โ
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.
https://github.com/docker/compose/issues/890#issuecomment -86630313.
์ด๊ฒ์ ๋น์ฐํ ์ผ์ด์ง๋ง TLS๋ฅผ ๋นํ์ฑํํ๊ฑฐ๋ OpenSSL์ ๋ค์ด ๊ทธ๋ ์ด๋ํ์ฌ์ด ์์ ์ ์ํํ๋ ์ฌ์ฉ์๋ ์ํ์ค์ธ ์์ ์ ๋ฐ๋ผ ์ ์คํ๊ฒ ์งํํด์ผํฉ๋๋ค.
์ด๊ฒ์ ๋ชจ๋ ๊ด๋ จ๋์ง ์์ต๋๋ค,ํ์ง๋ง ๋ ๋น์ทํ ์ค๋ฅ์ ํ์
ํ๋ค pip
์ฌ์ฉํ์ฌ ์ค์นํ๋ Dockerfile
์์ ๋น๊ฒจ gliderlabs/alpine:3.1
- progrium ๋ฐ ์น๋ฌด์์ ์ต์ํ์ ๋ฆฌ๋
์ค ์ปจํ
์ด๋์
๋๋ค. ๋ฌธ์ ๋ ์์คํ
์ธ์ฆ์ ํจํค์ง๋ฅผ ์ค์นํ์ง ์์๊ณ pip
๋ฅผ ์ค์นํ๊ธฐ ์ ์ ํจํค์ง๋ฅผ ์ค์นํ๊ณ ์๊ตฌ ์ฌํญ ํ์ผ์ ์คํํ์ฌ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค.
RUN apk-install -X ca-certificates
์ ์ ๋ ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ์ค์ ๋ก ์๋ํ์ง ์์์ต๋๋ค. 1.0.1 OpenSSL ๋ฒ์ ์ผ๋ก ์ ํ ํ ์ ์์ต๋๋ค. ๊ฒฐ๊ตญ ๋๋ ๋ชจ๋ pip-installed docker-compose ๋ฒ์ ์ ์ ๊ฑฐํ๊ณ brew install docker-compose
์ด๋ป๊ฒ ๋ ์๋ํ๋ค๋ ๊ฒ์ ๋ฐ๊ฒฌํ์ต๋๋ค.
์์ ์๋ฃจ์
์ ํจ๊ณผ๊ฐ ์์์ง๋ง ๋์๊ฒ๋ ๋๋ฌด ๋ฒ๊ฑฐ ๋กญ์ต๋๋ค. ๋น ๋ฅธ boot2docker upgrade
๋ชจ๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
์ด๋ฏธ ์ต์ boot2docker ๋ฒ์ ์ด ์์ผ๋ฉฐ ์์ ์์ ์ฌํญ ์์ด๋ ์๋ํ์ง ์์ต๋๋ค.
Homebrew ๊ฐ๋ฐ์๋ docker-py ๋ฐ docker-compose๊ฐ requests
2.6.0์ ์ฌ์ฉํ๋๋ก ์
๊ทธ๋ ์ด๋ํด์ผํ๋ค๊ณ ์ ์ํฉ๋๋ค.
https://github.com/Homebrew/homebrew/issues/38226#issuecomment -88083428
๋ฐ๋ผ๊ฑด๋ ์ด๊ฒ์ ๋๊ตฐ๊ฐ์๊ฒ ๋์์ด๋๊ธฐ๋ฅผ ๋ฐ๋๋๋ค ... ์๋ฃจ์ ์ด ํ์คํ์ง ์์ง๋ง Charles๋ฅผ Mac OS X ํ๋ก์๋ก ์ฌ์ฉํ๋ ๊ฒฝ์ฐ์ด ๋ฉ์์ง๊ฐ ํ์๋ฉ๋๋ค.
FWIW, pip๋ฅผ ํตํด docker-compose๋ฅผ ์ค์นํ๋ฉด docker-compose๊ฐ ์๋ํฉ๋๋ค (OS X Mavericks์์ curl์ ํตํด ์ค์นํ๋ฉด illegal operation
์ค๋ฅ๊ฐ ๋ฐ์ ํจ). ์ดํ์๋ SSL ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค. brew link --force openssl && brew switch openssl 1.0.1j
์คํํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ ๋ ๊ฒ ๊ฐ์ต๋๋ค.
@rseymour ๋๋ต์ด ๋๋ฅผ ์ํด ์ผํ์ต๋๋ค.
brew์์ openssl-1.0.1j
์ ์ฐพ์ง ๋ชปํ ์ฌ๋๋ค์ ์ํด-github repo์์ ์ด์ ๋ฒ์ ์ openssl ๋ ์ํผ๋ฅผ ๊ฐ์ ธ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
ยป brew switch openssl 1.0.1j
Error: openssl does not have a version "1.0.1j" in the Cellar.
Versions available: 1.0.2a-1
ยป brew unlink openssl
Unlinking /usr/local/Cellar/openssl/1.0.2a-1... 1543 symlinks removed
ยป brew install https://raw.githubusercontent.com/Homebrew/homebrew/62fc2a1a65e83ba9dbb30b2e0a2b7355831c714b/Library/Formula/openssl.rb
...
๐บ /usr/local/Cellar/openssl/1.0.1j_1: 431 files, 14M, built in 4.2 minutes
ยป docker-compose up
Creating myservice...
1.0.1m๋ฅผ ์๋ํ์ง๋ง ์๋ํ์ง ์์์ต๋๋ค.
๊ทธ๋์ @lazyval ๋ฐฉ์์ผ๋ก ์๋ํด ๋ณด์์ต๋๋ค.
์ด๊ฒ์ด ๋ด๊ฐ ํ ์ผ์
๋๋ค.
์์กฐ ์ค์น https://raw.githubusercontent.com/Homebrew/homebrew/62fc2a1a65e83ba9dbb30b2e0a2b7355831c714b/Library/Formula/openssl.rb
๋ธ๋ฃจ ์ค์์น openssl 1.0.1j_1
brew unlink openssl101 // ์ด์ ์ 1.0.1m๋ฅผ ์ฐ๊ฒฐํ๊ธฐ ๋๋ฌธ์
์์กฐ ๋งํฌ openssl --force
๋์ปค ์์ฑ PS
๊ฐ์ฌํฉ๋๋ค!!
ํ์ฌ Python 2.7.9 ์ด์์์ ๋ฐ์ด๋๋ฆฌ๋ฅผ ๋น๋ํด์ผํ๋ฏ๋ก์ด ๋ฌธ์ ๋ฅผ ์กฐ์ฌํ๊ณ ์์ต๋๋ค.
_ # 1427์์ ์ฌ๋ฐฐ์น _
์ฌ๊ธฐ๋ ์ฌ๋:
๊ณ ๊ฐ:
~/.docker/{ca.pem,cert.pem,key.pem}
๋ฐฐ์น ๋ SSL ์ธ์ฆ์DOCKER_HOST=tcp://docker-builder:2376
DOCKER_TLS_VERIFY=1
๋ค์ Makefile์ ์ฌ์ฉํ์ฌ SSL ์ธ์ฆ์ ๋น๋ :
#!/bin/bash
SERVER=docker-builder
clean:
rm ca.* server.* client.* *.key
all: ca.crt server.crt client.crt
%.key:
openssl genrsa -out $@ 4096
ca.crt: ca.key
openssl req -new -x509 -days 365 -key ca.key -sha256 -out ca.crt \
-subj "/C=US/ST=Texas/L=Austin/O=Abc123/OU=Operations/CN=${SERVER}/[email protected]"
server.csr: server.key
openssl req -new -key server.key -out server.csr \
-subj "/C=US/ST=Texas/L=Austin/O=Abc123/OU=Operations/CN=${SERVER}/[email protected]"
server.crt: ca.key ca.crt server.csr
openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key \
-CAcreateserial -out server.crt
client.csr: client.key
openssl req -new -key client.key -out client.csr \
-subj "/C=US/ST=Texas/L=Austin/O=Abc123/OU=Operations/CN=Docker Client/[email protected]"
client.ext.cnf:
echo "extendedKeyUsage = clientAuth" > client.ext.cnf
client.crt: client.csr ca.crt ca.key client.ext.cnf
openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key \
-CAcreateserial -out client.crt -extfile client.ext.cnf
๋ค์์์ด ๋จธ์ ์ ํ๋ก๋น์ ๋ํ๊ธฐ์ํ ์ฌ์ฉ์ ๋ฐ์ดํฐ ์คํฌ๋ฆฝํธ์ ๋๋ค (์ด์์ ์ธ ๊ฒ์ ์๋๋๋ค).
#cloud-config
write_files:
- path: /home/core/server.crt
owner: core:core
permissions: 0644
content: |
-----BEGIN CERTIFICATE-----
<cert goes here>
-----END CERTIFICATE-----
- path: /home/core/server.key
owner: core:core
permissions: 0644
content: |
-----BEGIN RSA PRIVATE KEY-----
<key goes here>
-----END RSA PRIVATE KEY-----
- path: /home/core/ca.crt
owner: core:core
permissions: 0644
content: |
-----BEGIN CERTIFICATE-----
<ca cert goes here>
-----END CERTIFICATE-----
coreos:
update:
reboot-strategy: reboot
units:
units:
- name: var-lib-docker.mount
command: start
content: |
[Unit]
Description=Mount RAM to /var/lib/docker
Before=docker.service
[Mount]
What=tmpfs
Where=/var/lib/docker
Type=tmpfs
Options=size=200g
- name: docker.service
command: restart
content: |
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
After=network.target
[Service]
ExecStartPre=/bin/mount --make-rprivate /
# Run docker but don't have docker automatically restart
# containers. This is a job for systemd and unit files.
ExecStart=/usr/bin/docker -d \
--tlsverify \
--tlscert=/home/core/server.crt \
--tlscacert=/home/core/ca.crt \
--tlskey=/home/core/server.key \
-H 0.0.0.0:2376 -H unix:///var/run/docker.sock
[Install]
WantedBy=multi-user.target
docker
ํด๋ผ์ด์ธํธ๋ฅผ ์ฌ์ฉํ์ฌ ์๊ฒฉ ๋์ปค ์๋ฒ์ ์ฑ๊ณต์ ์ผ๋ก ์ก์ธ์คํ์ต๋๋ค. ์ฐ๋ฆฌ๋ ์ฑ๊ณต์ ์ผ๋ก ์๊ฒฉ ์๋ฒ๋ฅผ ํ๋ฃจ์ ์ต๋ ์ญ๋ง ๋ฒ ํธ์ถํฉ๋๋ค.
docker-compose
, curl์ ํตํด ์ค์นํ๊ฑฐ๋ python 2.7๊ณผ ํจ๊ป pip install --upgrade
์ฌ์ฉํ๋ ค๊ณ ํ๋ฉด SSL ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
$ docker-compose up -d
SSL error: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
DOCKER_CERT_PATH=/home/user/.docker/
๋ฐ REQUESTS_CA_BUNDLE=/home/user/.docker/ca.pem
๋ฅผ ๊ฐ๋ณ์ ์ผ๋ก ๋๋ ํจ๊ป ์๋์ผ๋ก ์ง์ ํ ๊ฒฝ์ฐ์
๋๋ค.
๋ช
ํํ๊ฒ ๋งํ๋ฉด์ด ์ค์ ์ ๋์ปค ๋ฐ๋ชฌ์์๋ง ์ ์๋ํ์ง๋ง -compose
์ ์๋ชป๋์์ต๋๋ค.
๋ช ๊ฐ์ง ์ฐธ๊ณ ์ฌํญ :
$ python -V
$ python -c 'import ssl; print ssl.OPENSSL_VERSION'
์ค๋ฅ๋ฅผ ์ฌํ ํ ์์๋ ๋ก์ปฌ ์ปดํจํฐ์ Python 2.7.10
๋ฐ OpenSSL 1.0.2a 19 Mar 2015
์์ต๋๋ค.
ํ ์ ๋ง ์ด์ํฉ๋๋ค. ์ด๋ค ๋ฒ์ ์ b2d๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๊น?
๊ธฐ๊ณ? ์ฐ๋ฆฌ๋ ๋ ๋ค b2d๋ฅผ ์ฌ์ฉํ๋ฏ๋ก ๋ฌด์์ด ๋ค๋ฅผ์ง ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.
๋ฒ์ ์ธ์.
๋ด OS X ์ปดํจํฐ์ pip๋ฅผ ํตํด ์ค์นํ๊ณ ๋ด๊ฐ ์ป๋ ๊ฒ์ ๋ณผ ๊ฒ์ ๋๋ค.
2015 ๋
5 ์ 28 ์ผ ๋ชฉ์์ผ ์ค์ 9:19, Aanand Prasad [email protected]
์ผ๋ค :
๋ช ๊ฐ์ง ์ฐธ๊ณ ์ฌํญ :
1.
OSX ์ฉ Compose 1.3.0 RC1 ๋ฐ์ด๋๋ฆฌ์๋์ด ๋ฒ๊ทธ๊ฐ ์์ต๋๋ค. ์๋ง ์๋
์ฐ์ฐํ๋ ์ด๊ฒ์ Python 2.7.9์ ๋ํด ์ฒ์์ผ๋ก ๋น๋๋์์ต๋๋ค.
- ์ด์ ์๋ 2.7.6์ด์์ต๋๋ค.
2.์ด์ํ๊ฒ๋ boot2docker VM์ ๋ํด์๋ ์ฌํ ํ ์ ์์ง๋ง
๋จธ์ ์์ ํ๋ก๋น์ ๋ ํ Virtualbox VM. ํํ
https://github.com/ehazlett , @nathanleclaire
https://github.com/nathanleclaire , @tianon
https://github.com/tianon- ๊ฑฐ๊ธฐ์ ํต์ฐฐ๋ ฅ์ด ์์ต๋๊น?
์ผ.Compose๊ฐ Pip๊ณผ ํจ๊ป ์ค์น ๋ ๋ ์ด๊ฒ์ ๊ฒฝํํ๋ ์ฌ๋์๊ฒ, ์ ๋ฐ
๋ค์ ๋ช ๋ น์ ์ถ๋ ฅ์๋ณด๊ณ ํฉ๋๋ค.$ ํ์ด์ฌ -V
$ python -c 'import ssl; print ssl.OPENSSL_VERSION '์ค๋ฅ๋ฅผ ์ฌํ ํ ์์๋ ๋ก์ปฌ ์ปดํจํฐ์ Python์ด ์์ต๋๋ค.
2.7.10 ๋ฐ OpenSSL 1.0.2a 2015 ๋ 3 ์ 19 ์ผ.
4.์ด๊ฒ์ Homebrew์๋ณด๊ณ ๋์์ผ๋ฉฐ ์ผ๋ถ ์ฌ๋๋ค์
Python ๋ฐ OpenSSL์ ์ฑ๊ณต์ ์ผ๋ก ์ฌ์ค์นํ์ง๋ง ์ ์๊ฒ ํจ๊ณผ๊ฐ ์์์ต๋๋ค.
์์ / ์์ # 38226
https://github.com/Homebrew/homebrew/issues/38226โ
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.
https://github.com/docker/compose/issues/890#issuecomment -106306690.
$ boot2docker version
Boot2Docker-cli version: v1.6.2
Git commit: cb2c3bc
$ docker-machine --version
docker-machine version 0.2.0 (8b9eaf2)
์ธ์ฆ์ ์์ฑ์ ๋ํด ๋ค๋ฅธ ์ ์ด ์์ต๋๊น? ๋ด ์ปดํจํฐ ์ธ์ฆ์ ๋๋ ํ ๋ฆฌ์ boot2docker๋ณด๋ค ๋ ๋ง์ ํ์ผ์ด์๋ ๊ฒ ๊ฐ์ต๋๋ค.
$ $(boot2docker shellinit)
$ ls -l $DOCKER_CERT_PATH/*.pem
-rw-r--r-- 1 aanand staff 1042 28 May 14:27 /Users/aanand/.boot2docker/certs/boot2docker-vm/ca.pem
-rw-r--r-- 1 aanand staff 1070 28 May 14:27 /Users/aanand/.boot2docker/certs/boot2docker-vm/cert.pem
-rw-r--r-- 1 aanand staff 1675 28 May 14:27 /Users/aanand/.boot2docker/certs/boot2docker-vm/key.pem
$ eval "$(docker-machine env)"
$ ls -l $DOCKER_CERT_PATH/*.pem
-rw-r--r-- 1 aanand staff 1029 11 May 12:15 /Users/aanand/.docker/machine/machines/dev/ca.pem
-rw-r--r-- 1 aanand staff 1054 11 May 12:15 /Users/aanand/.docker/machine/machines/dev/cert.pem
-rw-r--r-- 1 aanand staff 1679 11 May 12:15 /Users/aanand/.docker/machine/machines/dev/key.pem
-rw------- 1 aanand staff 1679 11 May 12:15 /Users/aanand/.docker/machine/machines/dev/server-key.pem
-rw-r--r-- 1 aanand staff 1086 11 May 12:15 /Users/aanand/.docker/machine/machines/dev/server.pem
๊ด์ฐฎ์ต๋๋ค. ํด๋ผ์ด์ธํธ๋ ca.pem, cert.pem ๋ฐ key.pem ๋ง ์ฌ์ฉํฉ๋๋ค.
(์๋ฒ๋ ์์คํ
์ ํธ์คํธ์ ๋ํ ๋ก์ปฌ ๋ณต์ฌ๋ณธ์
๋๋ค). ๋๋ ๋ค์๊ณผ ๊ฐ์ด ๋ง๋ค ๊ฒ์ด๋ค.
์ํ๊ณ ์ธ์ฆ์๋ฅผ ๊ฒ์ฌํ์ฌ ์ฐจ์ด์ ์ด ๋ฌด์์ธ์ง ํ์ธํ์ญ์์ค.
2015 ๋
5 ์ 28 ์ผ ๋ชฉ์์ผ ์ค์ 9์ 30 ๋ถ, Aanand Prasad [email protected]
์ผ๋ค :
$ boot2docker ๋ฒ์
Boot2Docker-cli ๋ฒ์ : v1.6.2
ํ๋ด ์ปค๋ฐ : cb2c3bc$ docker-machine --version
docker-machine ๋ฒ์ 0.2.0 (8b9eaf2)์ธ์ฆ์ ์์ฑ์ ๋ํด ๋ค๋ฅธ ์ ์ด ์์ต๋๊น? ๋๋ ๋ ๋ง์ ๊ฒ ๊ฐ๋ค
๋ด boot2docker๋ณด๋ค ๋ด ์ปดํจํฐ ์ธ์ฆ์ ๋๋ ํ ๋ฆฌ์ ํ์ผ.$ $ (boot2docker shellinit)
$ ls -l $ DOCKER_CERT_PATH / *. pem
-rw-r--r-- 1 aanand staff 1042 5 ์ 28 ์ผ 14:27 /Users/aanand/.boot2docker/certs/boot2docker-vm/ca.pem
-rw-r--r-- 1 aanand staff 1070 28 May 14:27 /Users/aanand/.boot2docker/certs/boot2docker-vm/cert.pem
-rw-r--r-- 1 aanand staff 1675 28 May 14:27 /Users/aanand/.boot2docker/certs/boot2docker-vm/key.pem$ eval "$ (docker-machine env)"
$ ls -l $ DOCKER_CERT_PATH / *. pem
-rw-r--r-- 1 aanand staff 1029 11 May 12:15 /Users/aanand/.docker/machine/machines/dev/ca.pem
-rw-r--r-- 1 aanand staff 1054 11 May 12:15 /Users/aanand/.docker/machine/machines/dev/cert.pem
-rw-r--r-- 1 aanand staff 1679 11 May 12:15 /Users/aanand/.docker/machine/machines/dev/key.pem
-rw ------- 1 aanand staff 1679 11 5 ์ 12:15 /Users/aanand/.docker/machine/machines/dev/server-key.pem
-rw-r--r-- 1 aanand staff 1086 11 May 12:15 /Users/aanand/.docker/machine/machines/dev/server.pemโ
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.
https://github.com/docker/compose/issues/890#issuecomment -106309885.
grahamc@snap$ python -V
Python 2.7.6
grahamc@snap$ python -c 'import ssl; print ssl.OPENSSL_VERSION'
OpenSSL 1.0.1e-fips 11 Feb 2013
https://github.com/docker/docker-py/issues/465 ๋ @garethr ์ ํ ์คํธ ์คํฌ๋ฆฝํธ๋ ํธ์คํธ ์ด๋ฆ ๊ฒ์ฌ๋ฅผ ๋นํ์ฑํํ๊ธฐ ์ํด ํ๋์ ์์ ์ ํ ํ ์ค๋ฅ๋ฅผ ์ฌํํฉ๋๋ค.
from docker.client import Client
from docker.utils import kwargs_from_env
kwargs = kwargs_from_env()
kwargs['tls'].assert_hostname = False
client = Client(**kwargs)
print client.version()
$ eval "$(boot2docker shellinit)" && python test.py
Writing /Users/aanand/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/aanand/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/aanand/.boot2docker/certs/boot2docker-vm/key.pem
Traceback (most recent call last):
File "test.py", line 8, in <module>
print client.version()
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/docker/client.py", line 1108, in version
return self._result(self._get(url), json=True)
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/docker/client.py", line 106, in _get
return self.get(url, **self._set_request_timeout(kwargs))
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", line 477, in get
return self.request('GET', url, **kwargs)
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
ํ์ง๋ง ๋จธ์ ํ๋ก๋น์ ๋ ๋ VM์์๋ ๊ณ์ ์๋ํฉ๋๋ค.
$ eval "$(docker-machine env)" && python test.py
{u'KernelVersion': u'4.0.3-boot2docker', u'Arch': u'amd64', u'ApiVersion': u'1.18', u'Version': u'1.6.2', u'GitCommit': u'7c8fca2', u'Os': u'linux', u'GoVersion': u'go1.4.2'}
ํธ์คํธ ์ด๋ฆ ๊ฒ์ฌ๋ฅผ ๋ค์ ํ์ฑํํ๋ฉด (ํ
์คํธ ์คํฌ๋ฆฝํธ์์ assert_hostname
์ค์ ์ฃผ์ ์ฒ๋ฆฌํ์ฌ) boot2docker-cli VM์ ๋ํด์๋ ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ ํ์ง๋ง Machine VM์ ๋ํด์๋ ๋ค๋ฅธ ์ค๋ฅ๊ฐ ๋ฐ์ ํฉ๋๋ค. ๊ด๋ จ์ด ์์ ์ ์์ต๋๋ค.
Traceback (most recent call last):
File "test.py", line 8, in <module>
print client.version()
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/docker/client.py", line 1108, in version
return self._result(self._get(url), json=True)
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/docker/client.py", line 106, in _get
return self.get(url, **self._set_request_timeout(kwargs))
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", line 477, in get
return self.request('GET', url, **kwargs)
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: no appropriate commonName or subjectAltName fields were found
๋ํ curl (pip๊ฐ ์๋ ๋ฐ์ด๋๋ฆฌ ๋ฆด๋ฆฌ์ค)์ ํตํด v1.3.0-rc1์ ์ฌ์ฉํ๋ ค๊ณ ์๋ํ์ผ๋ฉฐ docker 1.6.2 ๋ฐ๋ชฌ์์ ์ด์ ๊ณผ ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
SSL error: [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
์-RC1 ๋ฐ์ด๋๋ฆฌ๋ Python 2.7.9 ๋ฐ OpenSSL 1.0.2a๋ก ๋น๋๋์์ผ๋ฉฐ ๋ฌธ์ ๊ฐ์๋ ์กฐํฉ ์ค ํ๋ ์ธ ๊ฒ ๊ฐ์ต๋๋ค.
์ด๊ฒ์ b2d์ ์ธ์ฆ์ ์์ฑ์ด VM์ ์๋ค๊ณ ๋ฏฟ๊ธฐ ๋๋ฌธ์ ์๋ฏธ๊ฐ ์์ต๋๋ค.
๊ธฐ๊ณ๋ ๊ธฐ๊ณ์์ ๊ทธ๋ค์ ์์ฑํฉ๋๋ค. ๊ฐ์งํ๊ณ ์ถ๊ฐ ํ ์ ์์ต๋๋ค.
ํ์ํ ๊ฒฝ์ฐ ์ปดํจํฐ ์ด๋ฆ์ SAN์ ์ถ๊ฐํฉ๋๋ค. ์ฌ์ค ์๋ง ์ข์ ๊ฒ ๊ฐ์์
ํนํ b2d VM์ ๊ฒฝ์ฐ. ์ง๊ธ ์๋ํ๋ ์ด์ ๋
๋จธ์ ์ด IP SAN์ผ๋ก ์ถ๊ฐํ๋ IP๋ฅผ ์ฌ์ฉํ์ฌ ์์ง์ ์ก์ธ์คํฉ๋๋ค. ์ด์๋ค
PR์ด ์ด๋ ค์๋ ์๋ํ๋ ์์์ ์ถ๊ฐ SAN์ ํ์ฉํฉ๋๋ค.
2015 ๋ 5 ์ 28 ์ผ ๋ชฉ์์ผ Aanand Prasad [email protected] ์ ๋ค์๊ณผ ๊ฐ์ด ์ผ์ต๋๋ค.
docker / docker-py # 465 ์ฐธ์กฐ
https://github.com/docker/docker-py/issues/465. ๋ฟก๋ฟก
https://github.com/garethr ์ ํ ์คํธ ์คํฌ๋ฆฝํธ๊ฐ ์ค๋ฅ๋ฅผ ์ฌํํฉ๋๋ค.
๋๋ ํธ์คํธ ์ด๋ฆ ๊ฒ์ฌ๋ฅผ ๋นํ์ฑํํ๊ธฐ ์ํด ํ๋์ ์์ ์ ํ ํ :docker.client์์ ๊ฐ์ ธ ์ค๊ธฐ ํด๋ผ์ด์ธํธ docker.utils์์ ๊ฐ์ ธ ์ค๊ธฐ kwargs_from_env
kwargs = kwargs_from_env ()
kwargs [ 'tls']. assert_hostname = Falseclient = Client (** kwargs) print client.version ()
$ eval "$ (boot2docker shellinit)"&& python test.py
/Users/aanand/.boot2docker/certs/boot2docker-vm/ca.pem ์์ฑ
/Users/aanand/.boot2docker/certs/boot2docker-vm/cert.pem ์์ฑ
/Users/aanand/.boot2docker/certs/boot2docker-vm/key.pem ์์ฑ
์ญ ์ถ์ (๊ฐ์ฅ ์ต๊ทผ ํธ์ถ ๋ง์ง๋ง) :
ํ์ผ "test.py", 8 ํ,
client.version () ์ธ์
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/docker/client.py", ์ค 1108, ๋ฒ์
return self._result (self._get (url), json = True)
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/docker/client.py", 106 ํ, _get
return self.get (url, * _self._set_request_timeout (kwargs))
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", 477 ํ, get
return self.request ( 'GET', url, * _kwargs)
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", 465 ํ, ์์ฒญ์
resp = self.send (prep, * _send_kwargs)
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", 573 ํ, ์ ์ก
r = adapter.send (์์ฒญ, * _kwargs)
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/adapters.py", 431 ํ, ์ ์ก ์ค
SSLError (e, request = request) ๋ฐ์
requests.exceptions.SSLError : [SSL : CERTIFICATE_VERIFY_FAILED] ์ธ์ฆ์ ํ์ธ ์คํจ (_ssl.c : 590)ํ์ง๋ง ๋จธ์ ํ๋ก๋น์ ๋ ๋ VM์์๋ ๊ณ์ ์๋ํฉ๋๋ค.
$ eval "$ (docker-machine env)"&& python test.py
{u'KernelVersion ': u'4.0.3-boot2docker', u'Arch ': u'amd64', u'ApiVersion ': u'1.18', u'Version ': u'1.6.2', u'GitCommit ': u'7c8fca2', u'Os ': u'linux', u'GoVersion ': u'go1.4.2'}ํธ์คํธ ์ด๋ฆ ๊ฒ์ฌ๋ฅผ ๋ค์ ํ์ฑํํ๋ฉด (assert_hostname์ ์ฃผ์ ์ฒ๋ฆฌํ์ฌ
ํ ์คํธ ์คํฌ๋ฆฝํธ์ ์ค)์ ๋ํด _same error_๋ก ์คํจํฉ๋๋ค.
boot2docker-cli VM์ด์ง๋ง ๋จธ์ VM์ ๋ํ _ ๋ค๋ฅธ ์ค๋ฅ _
๊ด๋ จ์ฑ์ด์์ ์๋ ์๊ณ ์๋ ์๋ ์์ต๋๋ค.์ญ ์ถ์ (๊ฐ์ฅ ์ต๊ทผ ํธ์ถ ๋ง์ง๋ง) :
ํ์ผ "test.py", 8 ํ,
client.version () ์ธ์
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/docker/client.py", ์ค 1108, ๋ฒ์
return self._result (self._get (url), json = True)
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/docker/client.py", 106 ํ, _get
return self.get (url, * _self._set_request_timeout (kwargs))
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", 477 ํ, get
return self.request ( 'GET', url, * _kwargs)
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", 465 ํ, ์์ฒญ์
resp = self.send (prep, * _send_kwargs)
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/sessions.py", 573 ํ, ์ ์ก
r = adapter.send (์์ฒญ, * _kwargs)
ํ์ผ "/Users/aanand/.virtualenvs/docker-compose/lib/python2.7/site-packages/requests/adapters.py", 431 ํ, ์ ์ก ์ค
SSLError (e, request = request) ๋ฐ์
requests.exceptions.SSLError : ์ ์ ํ commonName ๋๋ subjectAltName ํ๋๊ฐ ์์ต๋๋ค.โ
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.
https://github.com/docker/compose/issues/890#issuecomment -106363305.
์ข์, OS X์ ๋ํ ์์ ์ฌํญ์ ๋๋ฌํ๋ค๊ณ ์๊ฐํฉ๋๋ค : https://github.com/docker/compose/pull/1474
๋ฆฌ๋
์ค๋ฅผ ๊ณ ์ ํ๋ ๊ฒ์์์ ์์ ์ฃผ์ด์ง ์ฌ๋ฏธ์๋ ๋
ธ๋ ฅ ํ ๊ฒ์ด๋ค ํ์ด์ฌ 2.7.9 ๋ฐ OpenSSL์ 1.0.1๋ก ํ์ Dockerfile๋ฅผ ์
๋ฐ์ดํธ ํฌํจ ํ ๊ฒ์ด๋ค debian:wheezy
(์ฐ๋ฆฌ๊ฐ ์ถฉ๋ถํ ์ฌ์ฉํ๊ณ ํ์ธํ๊ธฐ ์ํด ์ํํ๋ old glibc-https://github.com/docker/compose/pull/505 ์ฐธ์กฐ).
@kretz ์ ์๊ฒฌ์ ์ค๋ช ๋๋๋ก 1.0.1k๋ก ์ ํํ๊ณ pip๋ฅผ ํตํด 1.3.0 RC1์ ์ค์นํ๋ฉด ๋์๊ฒ ํธ๋ฆญ์ด ์๊ฒผ ์ต๋๋ค.
Python์ ์ ํํ๊ธฐ ์ ์ 1.0.2a๋ฅผ๋ณด๊ณ ํ์ต๋๋ค.
โฏ python -c 'import ssl; print ssl.OPENSSL_VERSION'
OpenSSL 1.0.2a 19 Mar 2015
์ ํ ํ 1.0.1k๊ฐ๋ณด๊ณ ๋๊ณ docker-compose๊ฐ ์์๋๋ก ์๋ํ๋ ๊ฒ ๊ฐ์ต๋๋ค.
โฏ python -c 'import ssl; print ssl.OPENSSL_VERSION'
OpenSSL 1.0.1k 8 Jan 2015
์ด ์ค๋ฅ๋ฅผ ์ ๊ฑฐํ๋ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ๋ด virtualenv์ ๋ค์ ํจํค์ง๋ฅผ ์ค์นํ๋ ๊ฒ์
๋๋ค.
pip install pyopenssl==0.14 ndg-httpsclient==0.4 pyasn1==0.1.7
https://github.com/docker/compose/issues/890#issuecomment -106289821์ ์ค๋ช ๋ ํ๊ฒฝ์์ Python 2.7.6์ ์ ๊ณตํฉ๋๋ค (snap-ci.com์ ํตํด ๋ฌด๋ฃ ๊ณ์ ์ ์ป์ ์ ์์).
pip ์ค์น (https://github.com/docker/compose/issues/890#issuecomment-106806702)์์ @ jsh2134 ์ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ๋ ๋ค์ ์คํฌ๋ฆฝํธ๋ฅผ ์ฌ์ฉํฉ๋๋ค.
#!/bin/bash
set -e
set -u
set -x
readonly DOCKER_VERSION=1.5.0
readonly TARGETFILE=$SNAP_CACHE_DIR/docker-$DOCKER_VERSION
[[ -f "$TARGETFILE" ]] || curl https://get.docker.io/builds/Linux/x86_64/docker-$DOCKER_VERSION > $TARGETFILE
cp $TARGETFILE ~/docker
chmod +x ~/docker
export DOCKER_HOST="tcp://docker-builds:2376" DOCKER_TLS_VERIFY=1
mkdir -p ~/.docker
cat > ~/.docker/ca.pem <<EOC
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
EOC
cat > ~/.docker/key.pem <<EOC
-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----
EOC
cat > ~/.docker/cert.pem <<EOC
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
EOC
function install_docker_compose {
pip install --upgrade pip
pip install --upgrade docker-compose
pip install pyopenssl==0.14 ndg-httpsclient==0.4 pyasn1==0.1.7
export COMPOSE=docker-compose
}
install_docker_compose
export COMPOSE_PROJECT_NAME=$(basename "$(pwd)")-${SNAP_COMMIT:-HEAD}
# Before running anything, setup the EXIT trap to always rm the container on
# exit of the script.
function cleanup {
$COMPOSE kill
$COMPOSE rm --force
}
trap cleanup EXIT
$COMPOSE --version
$COMPOSE build
$COMPOSE up -d
set +e
$COMPOSE run $@
exitcode=$?
set -e
set +x
echo ""
echo "Component Data:"
for id in `$COMPOSE ps -q`; do
~/docker inspect \
-f 'Container {{ .Name }} exited with status {{ .State.ExitCode }}' $id
~/docker logs $id 2>&1 | sed -e "s/^/ /"
echo "---"
done
exit $exitcode
๋ค์ ์ถ๋ ฅ์ ์ป์ต๋๋ค.
+ readonly DOCKER_VERSION=1.5.0
+ DOCKER_VERSION=1.5.0
+ readonly TARGETFILE=/var/go/docker-1.5.0
+ TARGETFILE=/var/go/docker-1.5.0
+ [[ -f /var/go/docker-1.5.0 ]]
+ cp /var/go/docker-1.5.0 /var/go/docker
+ chmod +x /var/go/docker
+ export DOCKER_HOST=tcp://docker-builds:2376 DOCKER_TLS_VERIFY=1
+ DOCKER_HOST=tcp://docker-builds:2376
+ DOCKER_TLS_VERIFY=1
+ mkdir -p /var/go/.docker
+ cat
+ cat
+ cat
+ install_docker_compose
+ /bin/true
+ pip install --upgrade pip
/var/go/py-virtualenv2.7/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Collecting pip
Using cached pip-7.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 6.0.8
Uninstalling pip-6.0.8:
Successfully uninstalled pip-6.0.8
Successfully installed pip-7.0.1
+ pip install --upgrade docker-compose
/var/go/py-virtualenv2.7/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Requirement already up-to-date: docker-compose in /var/go/py-virtualenv2.7/lib/python2.7/site-packages
Requirement already up-to-date: docopt<0.7,>=0.6.1 in /var/go/py-virtualenv2.7/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: PyYAML<4,>=3.10 in /var/go/py-virtualenv2.7/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: requests<2.6,>=2.2.1 in /var/go/py-virtualenv2.7/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: texttable<0.9,>=0.8.1 in /var/go/py-virtualenv2.7/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: websocket-client<1.0,>=0.11.0 in /var/go/py-virtualenv2.7/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: docker-py<1.2,>=1.0.0 in /var/go/py-virtualenv2.7/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: dockerpty<0.4,>=0.3.2 in /var/go/py-virtualenv2.7/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: six<2,>=1.3.0 in /var/go/py-virtualenv2.7/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: backports.ssl-match-hostname in /var/go/py-virtualenv2.7/lib/python2.7/site-packages (from websocket-client<1.0,>=0.11.0->docker-compose)
+ pip install pyopenssl==0.14 ndg-httpsclient==0.4 pyasn1==0.1.7
Collecting pyopenssl==0.14
/var/go/py-virtualenv2.7/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading pyOpenSSL-0.14.tar.gz (128kB)
Collecting ndg-httpsclient==0.4
Downloading ndg_httpsclient-0.4.0.tar.gz
Collecting pyasn1==0.1.7
Downloading pyasn1-0.1.7.tar.gz (68kB)
Collecting cryptography>=0.2.1 (from pyopenssl==0.14)
Downloading cryptography-0.9.tar.gz (302kB)
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in /var/go/py-virtualenv2.7/lib/python2.7/site-packages (from pyopenssl==0.14)
Collecting idna (from cryptography>=0.2.1->pyopenssl==0.14)
Downloading idna-2.0.tar.gz (135kB)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /var/go/py-virtualenv2.7/lib/python2.7/site-packages (from cryptography>=0.2.1->pyopenssl==0.14)
Collecting enum34 (from cryptography>=0.2.1->pyopenssl==0.14)
Downloading enum34-1.0.4.tar.gz
Collecting ipaddress (from cryptography>=0.2.1->pyopenssl==0.14)
Downloading ipaddress-1.0.7-py27-none-any.whl
Collecting cffi>=0.8 (from cryptography>=0.2.1->pyopenssl==0.14)
Downloading cffi-1.0.3.tar.gz (317kB)
Collecting pycparser (from cffi>=0.8->cryptography>=0.2.1->pyopenssl==0.14)
Downloading pycparser-2.13.tar.gz (299kB)
Installing collected packages: idna, pyasn1, enum34, ipaddress, pycparser, cffi, cryptography, pyopenssl, ndg-httpsclient
Running setup.py install for idna
Running setup.py install for pyasn1
Running setup.py install for enum34
Running setup.py install for pycparser
Running setup.py install for cffi
Running setup.py install for cryptography
Running setup.py install for pyopenssl
Running setup.py install for ndg-httpsclient
Successfully installed cffi-1.0.3 cryptography-0.9 enum34-1.0.4 idna-2.0 ipaddress-1.0.7 ndg-httpsclient-0.4.0 pyasn1-0.1.7 pycparser-2.13 pyopenssl-0.14
+ export COMPOSE=docker-compose
+ COMPOSE=docker-compose
+++ pwd
++ basename /var/snap-ci/repo/tests/composer
+ export COMPOSE_PROJECT_NAME=composer-a71ac4f39281a9571a2b5da1284ab1c05da40646
+ COMPOSE_PROJECT_NAME=composer-a71ac4f39281a9571a2b5da1284ab1c05da40646
+ trap cleanup EXIT
+ docker-compose --version
docker-compose 1.2.0
+ docker-compose build
test1 uses an image, skipping
test2 uses an image, skipping
test uses an image, skipping
+ docker-compose up -d
SSL error: [Errno bad handshake] [('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')]
+ cleanup
+ docker-compose kill
SSL error: [Errno bad handshake] [('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')]
ํนํ ์ค๋ฅ (์๋ก์ด ๊ฒ์ผ๋ก ๋ณด์)์ ์ ์ํ์ญ์์ค.
/var/go/py-virtualenv2.7/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
์ง๊ธ๊น์ง ๋ด ๋ฐ๊ฒฌ์ ๋ธ๋ ์ธ ๋คํํ๊ธฐ ์ํด https://github.com/docker/compose/issues/1484 ๋ฅผ ๋ง๋ค์์ต๋๋ค.
# 1474์ ์์ ์ฌํญ์ ์ฌ์ฉํ์ฌ ์ผ๋ถ ๋ฐ์ด๋๋ฆฌ๋ฅผ ๋น๋ํ์ต๋๋ค. SSL ๋ฌธ์ ๊ฐ ๋ฐ์ํ ๊ฒฝ์ฐ ์๋ํด๋ณด์ธ์.
http://cl.ly/3W3a2S3t2c32/download/docker-compose-Linux-x86_64
http://cl.ly/0i00310l3x27/download/docker-compose-Darwin-x86_64
+ curl -L http://cl.ly/3W3a2S3t2c32/download/docker-compose-Linux-x86_64
+ /usr/bin/docker-compose --version
docker-compose version: 1.3.0rc1
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
+ /var/go/docker-compose up -d
SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
@ jsh2134 pyOpenSSL์ 0.14์ ์ ํํ ๊ณ ์ ํ๋ ์ด์ ๋ ๋ฌด์์ ๋๊น?
@kretz ๋ต๋ณ์ +1 :)
+1 ๋์ผํ ๋ฌธ์ :( osx์์ docker๊ฐ ์์ ํ ์์๋ ๊ฒ ๊ฐ์ต๋๊น?
@coderfi ์๋ฃจ์ ์ด ๋๋ฅผ ์ํด ์ผํ์ต๋๋ค .Windows 7 docker 1.7 Cygwin ๋ฐ Docker-compose๊ฐ Cygwin์์ pip๋ฅผ ํตํด ์ค์น๋จ
docker-machine์์ ์ปจํ ์ด๋๋ฅผ ์์ํ๋ ํด๋ผ์ด์ธํธ ์ญํ ์ํ๋ Centos7 VM์ ๋ณํ ์ค๋ฅ ์ค ํ๋๋ฅผ ์ฒ๋ฆฌํฉ๋๋ค.
[ root @ xxxx cm] # docker-compose ps
SSL ์ค๋ฅ : ์ ์ ํ commonName ๋๋ subjectAltName ํ๋๊ฐ ์์ต๋๋ค.
์ด๊ฒ์ ์ผ์์ ์ด์์ต๋๋ค. ๋ก๊ทธ ์์ํ๊ณ ssh๋ฅผ ๋ค์ ๋ก๊ทธ์ธํ๋ฉด ์ ์ ๋์ ์ค๋ฅ๊ฐ ํ์๋์ง ์์ต๋๋ค. ์ด์ ํญ์๋ณด๊ณ ์์ต๋๋ค.
[ root @ xxxx cm] # python -c 'import ssl; print (ssl.OPENSSL_VERSION) '
OpenSSL 1.0.1e-fips 2013 ๋
2 ์ 11 ์ผ
[ root @ xxxx cm] # Docker ๋ฒ์
ํด๋ผ์ด์ธํธ ๋ฒ์ : 1.6.2
ํด๋ผ์ด์ธํธ API ๋ฒ์ : 1.18
Go ๋ฒ์ (ํด๋ผ์ด์ธํธ) : go1.4.2
Git ์ปค๋ฐ (ํด๋ผ์ด์ธํธ) : ba1f6c3 / 1.6.2
OS / Arch (ํด๋ผ์ด์ธํธ) : linux / amd64
์๋ฒ ๋ฒ์ : swarm / 0.2.0
Go ๋ฒ์ (์๋ฒ) : go1.3.3
Git ์ปค๋ฐ (์๋ฒ) : 48fd993
OS / Arch (์๋ฒ) : linux / amd64
[ root @ xxxx cm] # docker-compose --version
๋์ปค ์์ฑ 1.2.0
๋ด ํ๊ฒฝ์์ ์์์ ์ธ๊ธ ํ ์ผ๋ถ ์์ ์ฌํญ์ ์ ์ฉํ๋ ๋ฐฉ๋ฒ์ ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ์ ๋ boot2docker๋ฅผ ์ฌ์ฉํ์ง ์์ต๋๋ค. bash ๋ช ๋ น ์ค์์ ๋ฐ๋ก ๋์ปค 1.6.2๋ฅผ ์ฒ๋ฆฌํฉ๋๋ค.
์๋ ํ์ธ์. ๋๋ ๊ทธ ์์ธ์ ๋ํ ๋ฌธ์ ๋ฅผ ์ค์ ๋ก ์ด์์ต๋๋ค. ๋๋ pip / brew / newst ๋ฒ์ ์ผ๋ก compose๋ฅผ ์ค์นํ๋ ๋ฑ ๋ง์ ๊ฒ์ ์๋ํ์ต๋๋ค. openssl์ด 0.x 1.0.2x ๋ฒ์ ๋ฑ์ ์๋ํ์ง๋ง ์ฌ์ ํ ์๋ํ์ง ์๋ ๊ฒ๊ณผ ๊ฐ์ต๋๋ค.
์ถ์ : ์ ๋ boot2docker๋ฅผ ์ฌ์ฉํ์ง ์์ต๋๋ค. ๋๋ vagrant๋ฅผ ํตํด ๋ง๋ค๊ณ ์ธ์ฆ์๋ฅผ ์์ฑํ๊ณ Docker ๋ฐ๋ชฌ์ ์์ํ๋ ์์ฒด VM์ ๊ฐ์ง๊ณ ์์ต๋๋ค. ๋ถ๋ช ํ ๊ทธ๊ฒ์ ๋์ปค์ ํจ๊ป ์๋ํ๋ฏ๋ก ๋ฌธ์ ๋ ๋ด ์ธ์ฆ์์์ ๋ฐ์ํ์ง ์์ต๋๋ค.
>>> docker run hello-world
Hello from Docker.
[...]
>>> docker-compose up
SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
>>> docker-compose -v
docker-compose version: 1.3.1
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1j 15 Oct 2014
>>> docker -v
Docker version 1.6.2, build 7c8fca2
ํ ๋ฒ์์ด ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
/usr/local/Cellar/fig/1.3.1/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
SSL error: [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
์ฌ๊ธฐ๋ฅผ ์ฝ๊ณ ์ ์ ๋ ํจํค์ง๋ฅผ ์ค์น ํ ํ :
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning
docker-compose์ ์ค๋ฅ ๋ฉ์์ง๊ฐ ๋ณ๊ฒฝ๋์์ต๋๋ค.
[ root @ xxx cm] # docker-compose up -d
/usr/lib/python2.7/site-packages/requests/packages/urllib3/connection.py:251 : SecurityWarning : Certificate has no subjectAltName
, fall back to check for commonName
for ์ง๊ธ. ์ด ๊ธฐ๋ฅ์ ์ฃผ์ ๋ธ๋ผ์ฐ์ ์์ ์ ๊ฑฐ๋๊ณ RFC 2818์์ ๋ ์ด์ ์ฌ์ฉ๋์ง ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ https://github.com/shazow/urllib3/issues/497์ ์ฐธ์กฐํ์ญ์์ค.
๋ณด์ ๊ฒฝ๊ณ
SSL ์ค๋ฅ : ํธ์คํธ ์ด๋ฆ 'xx.xx.xx.xx'๊ฐ ์ผ์นํ์ง ์์ ์์
(์ ์ ์ผ๋ก ํ์๋ ์ฟผ๋๋ ์ค์ ๋ง์คํฐ / ๋์ปค ํธ์คํธ์ ๋๋ค).
์ธ์ฆ์๋ฅผ ํธ์งํ๊ฑฐ๋ ๋ค์ ์์ฑํ์ฌ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์๋ ์์ต๋๊น?
๋ถ๋ก : ์ธ์ฆ์๋ "docker-machine create"์ ์ํด ์ด๋ฌํ VM์ ์์ฑ๋์์ต๋๋ค.
๋ถ์ถฉ๋ถํ๊ฒ ์์ธํ ์ธ์ฆ์๋ฅผ ์์ฑํ๋ ๋์ปค ๋จธ์ ์ ๋ฒ๊ทธ๋ฅผ ์ฒ๋ฆฌ ํ ์ โโ์์ต๋๊น?
์ด ์ค๋ฅ๋ docker-machine์์ ๋ง๋ Docker ํธ์คํธ์์๋ง ๋ณผ ์ ์์ต๋๋ค. SSL ์ธ์ฆ์๊ฐ ์ ๋๋ก ์์ฑ๋์ง ์๋๋ค๊ณ ์๊ฐํฉ๋๊น?
๋๊ตฌ๋ ์ง์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ์ํ ํด๊ฒฐ ๋ฐฉ๋ฒ์ด๋ ํด๊ฒฐ์ฑ ์ด ์์ต๋๊น? ์ด๊ฒ์ ์ง๊ธ ๋์๊ฒ ์ฝ๊ฐ์ ์ฐจ๋จ์ ์ ๋๋ค : /
@prologic ๋ฐ์ด๋๋ฆฌ ๋๋ Pip์ด ์ค์น๋ Compose์์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๊น? ํ์์ ๊ฒฝ์ฐ requests[security]
๋ ์ค์นํด๋ณด์ญ์์ค.
@aanand ๊ฐ์ฌํฉ๋๋ค! ๋๋ ๊ทธ๊ฒ์ ์๋ํ๊ณ ๊ทธ๊ฒ์ด ์๋ํ๋์ง๋ณด๊ณ ํ ๊ฒ์ด๋ค!
@prologic ์ฐ๋ฆฌ๋ ํ์ด์ฌ์ ๋ฒ๊ทธ๊ฐ ๋ง์ SSL ๋ชจ๋์ ์์กดํ๋ ๋์ requests[security]
๋ฅผ ํจํค์งํ๊ณ ์ถ์ต๋๋ค. ์ฐ๋ฆฌ๋ # 1530์ ๋
ธ๋ ฅ์ ์ถ์ ํ๊ณ ์์ต๋๋ค.
@aanand ๊ฐ์ฌํฉ๋๋ค! ์ด๊ฒ์ ์๋ฒฝํ๊ฒ ์๋ํ์ต๋๋ค :)
@coderfi ๊ทํ์ ์๋ฃจ์ ์ด ์ ์๊ฒ
@aanand 6 ์ 2 ์ผ ๋น๋๊ฐ ์ ์๋ํฉ๋๋ค. ์ด ๊ณ ํต์ค๋ฌ์ด ๋ฒ๊ทธ๋ฅผ ์์ ๋ ํ์ด์ ๋น๋๋ค.
@neilsarkar ๋๋ ์ฐฐ์ค ํ๋ก์๋ฅผ ์คํํ๊ณ ์์๋๋ฐ, ๋น์ ์ ์๊ฒฌ์ ๋๋ฅผ ๊ตฌํ์ต๋๋ค. : +1 :
์ ๋ OS X 10.9.5๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
# โ openssl version
# OpenSSL 1.0.2d 9 Jul 2015
โ pyenv local system # switch to built-in python 2.7.5 for current directory
# โ python --version
# Python 2.7.5
# โ python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
# OpenSSL 0.9.8zd 8 Jan 2015
# โ docker-compose --version
# docker-compose version: 1.3.1
# CPython version: 2.7.5
# OpenSSL version: OpenSSL 0.9.8zd 8 Jan 2015
# โ docker-compose ps
# /usr/local/Cellar/fig/1.3.1/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
# InsecurePlatformWarning
# Name Command State Ports
# ------------------------------
๋ด ํด๊ฒฐ ๋ฐฉ๋ฒ :
246 : 253 ์ค์ ์ฃผ์ ์ฒ๋ฆฌ
/usr/local/Cellar/fig/1.3.1/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/connection.py
์ด๊ฒ์ ๋ณด์ ์์ธ๋ฅผ ๋ฐ์์ํค๋ ๋ถ๋ถ์ ๋๋ค.
๋์๊ฒ ๋ฌธ์ ๋ ๋ด๊ฐ brew link --force openssl์ ์ง์ ํ๋๋ผ๋ fig / docker-compose๋ ์ฌ์ ํ / usr / bin / openssl์ ์ฌ์ฉํ๋ค๋ ๊ฒ์ ๋๋ค.
$ sudo mv /usr/bin/openssl /usr/bin/openssl_old
$ brew link --force openssl OR brew unlink openssl && brew link --force openssl
์ด๊ฒ์ ๋๋ฅผ ์ํด ์ผํ์ต๋๋ค. ์ด์ ๋ ์ด์ ์ฑ๊ฐ์ ๋ฉ์์ง๋ฅผ๋ฐ์ง ์์ต๋๋ค.
์ฐธ๊ณ ๋ก, brew fig / docker-compose recipe๋ ์์คํ ํ์ด์ฌ์ ์ฌ์ฉํ๋ฏ๋ก pyenv ๋๋ brew๋ฅผ ํตํด ํ์ด์ฌ์ ์ค์นํ๋๋ผ๋ brew install fig / docker-compose๋ ์ฌ์ฉ ๊ฐ๋ฅํ ๊ฒฝ์ฐ ์์คํ openssl lib๋ฅผ ๊ณ์ ์ฌ์ฉํ๊ณ ๊ทธ๋ ์ง ์์ผ๋ฉด ๋ค๋ฅธ ๋ฒ์ ์ ์ค์นํฉ๋๋ค.
์ง์ฅ ๋ด MAC์์ pyenv install 2.7.8, easy_install pip ๋ฐ pip install docker-compose๋ก ํด๊ฒฐํ์ต๋๋ค.
ํ์ง๋ง ์ง์์๋ ๋ด Mac์์ "๋ ๋ค ์์ธ๋ฏธํฐ๋ฅผ ์คํ ์ค"์ด๋ผ๊ณ ํฉ๋๋ค. ๋์ผํ ์์ ์ ์ํํ์ง๋ง ์ฌ์ ํ ๊ฒฝ๊ณ ๊ฐ ํ์๋ฉ๋๋ค.
๊ณ์ ํ๊ณ ์์ต๋๋ค.
@dtunes- ๊ทผ๋ณธ ์์ธ ( @aanand ์์์ ์ฐธ์กฐ)์ https://github.com/boot2docker/boot2docker/issues/808์ ๋๋ค. system-python / homebrew-python์ ์๋กญ๊ฑฐ๋ ์ค๋๋ OpenSSL์ ์ฐ๊ฒฐ๋์๋์ง ์ฌ๋ถ์ ๋ฐ๋ผ ๋ฌ๋ผ์ง๊ธฐ ๋๋ฌธ์ ๋ถ์ ์ฒญ์ด์ ๋๋ค.
๋ค, ๊ทธ ํฐ์ผ์ ๋ดค์ด์. ๋๋ฅผ ๊ดด๋กญํ๋ ๊ฒ์ ์ง์ฅ์์ Mac์์ ์์ ๋ค๋ฅธ ์ ๊ทผ ๋ฐฉ์์ ์๋ํ ํ ํจ๊ณผ๊ฐ ์๋ค๋ ๊ฒ์
๋๋ค.
๊ทธ๋ฐ ๋ค์ / usr / bin / openssl์ / usr / bin / openssl_old๋ก ์ด๋ํ๊ณ home brew๋ฅผ ์ฌ์ฉํ์ฌ ์ต์ openssl์ ์ค์นํ๊ณ ๊ฐ์ ๋ก ์ฐ๊ฒฐํ์ต๋๋ค. ๊ทธ๋์๋ง ๋ค์์ ์ํํ์ต๋๋ค.
~ $ brew install pyenv
~ $ pyenv install 2.7.8
~ $ pyenv global 2.7.8
~ $ easy_install pip
~ $ pip install docker-compose
์ด๊ฒ์ ์ง์ฅ์์ ํธ๋ฆญ์ ์ํํ์ง๋ง ์ง์ Mac์์๋ ์๋ํ์ง ์์์ต๋๋ค. ํ์ง๋ง ์ค์ ํ ๊ฒฝ์ฐ๋ฅผ ๋๋นํ์ฌ ๋ค์ ์๋ํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ๋ค์๋ณด๊ณ ํ๊ฒ ์ต๋๋ค.
@dtunes- ๋ชจ๋ ์ข
์์ฑ์ ๋ค์ ๋น๋ํ๋ ค๋ฉด ์๋ชป๋ OpenSSL์ ๋ํด ๋น๋ ๋ ์บ์ ๋ ๋ฐ์ด๋๋ฆฌ ํ ์ด ๋ค์ ์ฌ์ฉ๋์ง ์๋๋ก ~/Library/Caches/pip
๋ฅผ ์ ๊ฑฐํด์ผํฉ๋๋ค.
@glyph ๋ ๋ค์ ๊ณผ ๊ฐ์ด ์ผ์ต๋๋ค .
๊ทผ๋ณธ ์์ธ ( @aanand ์์์ ์ฐธ์กฐ)์ boot2docker / boot2docker # 808์ ๋๋ค. system-python / homebrew-python์ ์๋กญ๊ฑฐ๋ ์ค๋๋ OpenSSL์ ์ฐ๊ฒฐ๋์๋์ง ์ฌ๋ถ์ ๋ฐ๋ผ ๋ฌ๋ผ์ง๊ธฐ ๋๋ฌธ์ ๋ถ์ ์ฒญ์ด์ ๋๋ค.
@glyph ๋๋ @aanand , # 1474์์ ๋ณํฉ ๋ @aanand ์ ์์ (ํด๊ฒฐ ๋ฐฉ๋ฒ)์ด ๊นจ์ง b2d๋ฅผ ์์ฉํ๋ค๋ ๊ฒ์ ์์ํฉ๋๊น? @aanand , boot2docker / boot2docker # 808 ์ฃผ์๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ง์ ๋๋ฉด # 1474๋ฅผ ์ ๊ฑฐํด์ผํฉ๋๊น? ๋ค์ ์ํธํ ๋ฆด๋ฆฌ์ค ( this ๋ฐ this ์ฐธ์กฐ)์ ํฌ๋ง์ ๋๋ ๊ฒ๋ ๋ถ์ ์ฒญ์ด์ ๋๊น?
@aanand ๋ ๋ค์ ๊ณผ ๊ฐ์ด ์ผ์ต๋๋ค .
docker-machine์ผ๋ก ํ๋ก๋น์ ๋ ๋ Boot2Docker VM์ ๋ํด์๋์ด ์ค๋ฅ๋ฅผ ์ฌํ ํ ์ ์์ต๋๋ค. boot2docker ๋ช ๋ น์ผ๋ก ํ๋ก๋น์ ๋ ๋ VM์ ๋ํด์๋ง ๋ฐ์ํฉ๋๋ค.
@ehazlett ์ผ๋ค :
์ด๊ฒ์ b2d์ ์ธ์ฆ์ ์์ฑ์ด VM์ ์๊ณ ์์คํ ์ด ์์คํ ์์ ์์ฑํ๋ค๊ณ ๋ฏฟ๊ธฐ ๋๋ฌธ์ ์๋ฏธ๊ฐ ์์ต๋๋ค.
์คํด๋ฅผ ๋ฐ์์ ์๋ ์์ง๋ง์ด ๋ฌธ์ ์ ๊ด๋ จ ๋ฌธ์ ์ ๋ํ ๋ค์ํ ํธ์คํธ ์ธก Python / OpenSSL ์กฐํฉ์ ๋น๋ํ๋ ์๋ค์์ด๊ฐ ๋ง์ต๋๋ค. ๋ฌธ์ ์ ์์ธ์ด b2d์ ํจ๊ป ๋ฐฐํฌ ๋ ์์๋ OpenSSL ์ธ ๊ฒฝ์ฐ ๊ฐ์ฅ ์ข์ ๋ฐฉ๋ฒ์ Compose์ ํธ์คํธ ์ธก OpenSSL์ด ๋น์ทํ๊ฒ ์์๋์๋์ง ํ์ธํ๋ ๊ฒ์ ๋๋ค. ๊ทธ๋งํ ๊ฐ์น๊ฐ ์๊ธฐ ๋๋ฌธ์ ์ด๋ฌํ ์ ํ์ ํธ์คํธ ์ธก ์๊ณก์ (์) Vagrant๋ฅผ ํตํด b2d๋ฅผ ์คํํ๊ณ Compose ์ธ๋ถ์์ ์ก์ธ์คํ๋ ์ฌ๋๋ค์๊ฒ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ง ๋ชปํ ๊ฒ์ ๋๋ค (์ : docker / docker-py # 465 ์ฐธ์กฐ ).
์ด ์ฃผ์์ด boot2docker / boot2docker # 808์์ ๋ ์ ์ ํ๋ค๋ฉด, ๊ฑฐ๊ธฐ๋ก ์ฎ๊ธธ ์ ์์ต๋๋ค.
์ ๋ Homebrew ๋ฉ์ธํ ์ด๋์ด๊ณ Glyph๊ฐ ์ด๊ฒ์ ์คํํ๋ ๊ฒ์ ๋์์ต๋๋ค.
boot2docker๊ฐ ์์ฑ ํ ์๋ฒ ์ธ์ฆ์์ ์ ๋ชฉ ๋ฐ ๋ฐ๊ธ์ DN์ /O=Boot2Docker
๋ก ๋์ผํ๊ฒ ์ค์ ๋ฉ๋๋ค. ์๋ฒ ์ธ์ฆ์๊ฐ ์ค์ ๋ก CA ์ธ์ฆ์์ ์ํด ์๋ช
๋์๋ค๊ณ ์๊ฐํ์ง๋ง AFAICT OpenSSL 1.0.2๋์ด ์ ๋ณด (์ฆ, ๋์ผํ ์ฃผ์ฒด ๋ฐ ๋ฐ๊ธ์ DN)๋ฅผ ์ฌ์ฉํ์ฌ ์ ๊ณต๋ ์๋ฒ ์ธ์ฆ์์ ๋ํด ์๋ฒ ์ธ์ฆ์๋ฅผ ํ์ธํ๋ ๋์ ์์ฒด ์๋ช
๋ ๊ฒ์ผ๋ก ์๋ฒ ์ธ์ฆ์๋ฅผ ๊ฑฐ๋ถํฉ๋๋ค. CA ์ธ์ฆ์. 1.0.2 ์ด์ ์ OpenSSL ๋ฒ์ ์ ์ ๊ณต๋ CA ์ธ์ฆ์์ ๋ํด ์๋ฒ ์ธ์ฆ์์ ์ ํจ์ฑ์ ๊ฒ์ฌํฉ๋๋ค.
์๋ฒ ๋ฐ CA ์ธ์ฆ์์ ๊ณ ์ ํ ์ฃผ์ DN์ ์ ๊ณตํ๋ฉด (์๋ฒ ์ธ์ฆ์๊ฐ ๊ณ ์ ํ ์ฃผ์ ๋ฐ ๋ฐ๊ธ์ DN์ ๊ฐ๋๋ก) ์ธ์ฆ์๊ฐ ๋ชจ๋ OpenSSL ๋ฒ์ ์์ ์ ํจ์ฑ์ ๊ฒ์ฌ ํ ์ ์๋ค๊ณ ๋ฏฟ์ง๋ง ํ ์คํธํ์ง๋ ์์์ต๋๋ค. ๋๋ ( ์ด X.509 ์์กด ๊ฐ์ด๋๋ฅผ ์ฝ์์ง๋ง ๊ด๋ จ ์ฌ์์ด ์๋) ์์ฌํ์ง๋ง OpenSSL 1.0.2์ ๋์์ด ํฉ๋ฆฌ์ ์ด๋ฉฐ OpenSSL ๊ฐ๋ฐ์๊ฐ ํด๊ฒฐํด์ผ ํ ํ๊ท๋ฅผ ๋ํ๋ด์ง ์๋๋ค๊ณ ํ์ ํ์ง ์์ต๋๋ค.
๋ฌธ์ ์ ์์ธ์ด b2d์ ํจ๊ป ๋ฐฐํฌ ๋ ์์๋ OpenSSL ์ธ ๊ฒฝ์ฐ
๊ทธ๋ ์ง ์์ต๋๋ค. ์ด ์ฝ๋๋ก ์์ฑ ๋ boot2docker ์ธ์ฆ์๋ OpenSSL โฅ 1.0.2๋ฅผ ์ฌ์ฉํ๋ ํด๋ผ์ด์ธํธ์ ๋ฐ๋ผ ์ ํจํ์ง ์์ต๋๋ค. boot2docker์ ํจ๊ป ๋ฐฐํฌ ๋ OpenSSL ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ๊ด๋ จ์ด ์์ต๋๋ค.
@glyph ๋๋ @aanand , # 1474์์ ๋ณํฉ ๋ @aanand ์ ์์ (ํด๊ฒฐ ๋ฐฉ๋ฒ)์ด ๊นจ์ง b2d๋ฅผ ์์ฉํ๋ค๋ ๊ฒ์ ์์ํฉ๋๊น? @aanand , boot2docker / boot2docker # 808 ์ฃผ์๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ง์ ๋๋ฉด # 1474๋ฅผ ์ ๊ฑฐํด์ผํฉ๋๊น? ๋ค์ ์ํธํ ๋ฆด๋ฆฌ์ค (์ด๊ฒ๊ณผ ์ด๊ฒ์๋ณด์ธ์)์ ํฌ๋ง์ ๋๋ ๊ฒ ์ญ์ ๋ถ์ ์ฒญ์ด์ ๋๊น?
๋ค, ๊ทธ๋ ๊ฒ ์๊ฐํฉ๋๋ค. ๋ฌธ์ ๊ฐ์๋ OpenSSL์ 1.0.2์ด๋ฉฐ, 1.0.1๋ก ์ ํํ๋ฉด ์ธ์ฆ์ ์คํจ๋ฅผ ์ ๋ฐํ๋ ํ์ธ ๋ ผ๋ฆฌ๋ฅผ ํผํ ์ ์์ต๋๋ค. ๋๋ ์ฌ์ ํ _what_ ๊ทธ๊ฒ์ด ๋ง์์ ๋ค์ง ์๋ ์ธ์ฆ์์ ๊ดํ ๊ฒ์ธ์ง ๋ชจ๋ฅธ๋ค. ์ค๋ฅ ๋ฉ์์ง๊ฐ ๋๋ฌด ๋ฌด๋ ๊ธฐ ๋๋ฌธ์ด๋ค.
๋ํ # 1474๊ฐํ๋ ์ผ์ด ๋๋ฌด ๊ตฌ์ฒด์ ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค. ์ ์ด๋ ๋ด ๋ ์์์ _minimum_ python ๋ฒ์ ์ ์ค์ ํ์ง ์๊ณ _exact_ ๋ฒ์ ์ ์ง์ ํฉ๋๋ค. ๋ํ j์ ๋ค๋ฅธ 1.0.1์ด ์๋์ง ํ์ธํ๋ ๋ฐ ์คํจํ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค. ์ฆ, 1.0.1์๋ ๋ณด์ ์ ๋ฐ์ดํธ๊ฐ ์ ์ฉ๋์ง ์์ผ๋ฉฐ ์ด๋ _ ํ์คํ _ ๋ฌธ์ ์ ๋๋ค.
์๋ฒ ๋ฐ CA ์ธ์ฆ์์ ๊ณ ์ ํ ์ฃผ์ DN์ ์ ๊ณตํ๋ฉด (์๋ฒ ์ธ์ฆ์๊ฐ ๊ณ ์ ํ ์ฃผ์ ๋ฐ ๋ฐ๊ธ์ DN์ ๊ฐ๋๋ก) ์ธ์ฆ์๊ฐ ๋ชจ๋ OpenSSL ๋ฒ์ ์์ ์ ํจ์ฑ์ ๊ฒ์ฌ ํ ์ ์๋ค๊ณ ๋ฏฟ์ง๋ง ํ ์คํธํ์ง๋ ์์์ต๋๋ค. ๋๋ (์ด X.509 ์์กด ๊ฐ์ด๋๋ฅผ ์ฝ์์ง๋ง ๊ด๋ จ ์ฌ์์ด ์๋) ์์ฌํ์ง๋ง OpenSSL 1.0.2์ ๋์์ด ํฉ๋ฆฌ์ ์ด๋ฉฐ OpenSSL ๊ฐ๋ฐ์๊ฐ ํด๊ฒฐํด์ผ ํ ํ๊ท๋ฅผ ๋ํ๋ด์ง ์๋๋ค๊ณ ํ์ ํ์ง ์์ต๋๋ค.
docker-machine
-์์ฑ ๋ ์ธ์ฆ์๋ฅผ ์กฐ์ฌํ๊ณ ์ด ์์ฑ์ด ์๋์ง ํ์ธํฉ๋๋ค. OpenSSL์์์ด ๋์์ด ํ์ฉ ๊ฐ๋ฅํ๊ฑฐ๋ ํ๊ท๊ฐ ์๋ ์ด์ ๋ ๋ฌด์์
๋๊น? ์์ฒด ์๋ช
๋ ์ธ์ฆ์๋ฅผ ์ ๋ขฐํ๋ ๊ฒ์ ์๋ฒฝํ๋ฉฐ ์ฃผ์ฒด ๋๋ ๋ฐ๊ธ์๊ฐ ๋ด๊ฐ ์๊ณ ์๋ ๋ด์ฉ์ ๋ํ ํน๋ณํ ์ ํ์ด ์์ต๋๋ค. ์ด ๊ฐ์ด๋๋ฅผ ์กฐ๊ธ ํ์ด ๋ดค๋๋ฐ ์์ฒด ์๋ช
์ธ์ฆ์์๋ CA- ์นด๋ฅดํ
์ ๋ขฐ๊ฐ ์์ผ๋ฏ๋ก ์น ๋ธ๋ผ์ฐ์ ๋ ์ถ๊ฐ ๊ตฌ์ฑ ์์ด๋ ์ ๋ขฐํ์ง ์์ ๊ฒ์์ ์ง์ ํ๋ ๊ฒ ๊ฐ์ต๋๋ค.
๋ด docker-machine
VM์ ์ธ์ฆ์๋ฅผ ๋ณด๋ฉด ๋ค์์ด ํ์๋ฉ๋๋ค.
...
Issuer: O=glyph
...
Subject: O=dev
...
๊ทธ๋์ ๋น์ ์ด ์ณ์ ์ ์์ต๋๋ค ...
docker-machine-generated cert๋ฅผ ์กฐ์ฌํ๊ณ [matching Subject and Issuer DNs]๊ฐ ์๋์ง ํ์ธํ๊ฒ ์ต๋๋ค.
aanand์ docker-machine ์ธ์ฆ์์๋ ๊ณ ์ ํ DN์ด ์์์ ์ ์ ์์ต๋๋ค. https://gist.github.com/aanand/3d865623481ba8ae66ee#file -docker-machine-log-L30-L32
์์ฒด ์๋ช ๋ ์ธ์ฆ์๋ฅผ ์ ๋ขฐํ๋ ๊ฒ์ ์๋ฒฝํฉ๋๋ค.
๊ทธ๋ฌ๋ ์์ฒด ์๋ช ๋ ์ธ์ฆ์๋ฅผ ์ ๋ขฐํ์ง ์๋ ํ ์์ฒด ์๋ช ๋ ์ธ์ฆ์๋ ์ ํจํ์ง ์์ต๋๋ค. OpenSSL์ ์๋ฒ ์ธ์ฆ์๋ฅผ ์ ๋ขฐํ๋๋ก ์ง์ํ์ง ์์ต๋๋ค. OpenSSL์ ์๋ฒ ์ธ์ฆ์๋ฅผ ๋ฐ๊ธ ํ CA๋ฅผ ์ ๋ขฐํ๋๋ก ์ง์ํฉ๋๋ค.
OpenSSL์์์ด ๋์์ด ํ์ฉ ๊ฐ๋ฅํ๊ฑฐ๋ ํ๊ท๊ฐ ์๋ ์ด์ ๋ ๋ฌด์์ ๋๊น?
IANAL,ํ์ง๋ง ๋ด ์ถ๋ก ์ "์๊ฒฉํ ์์ค์์ [์์ฒด ์๋ช ]์ ์ธ์ฆ์์ ๋ฐ๊ธ์์ ์ฃผ์ ํ๋๊ฐ ๋์ผ ํจ์ ์๋ฏธํฉ๋๋ค."๋ผ๋ ์ธ์ด์์ ํ์๋์์ต๋๋ค. ์ด๊ฒ์ด boot2docker ์๋ฒ ์ธ์ฆ์์ ๊ฒฝ์ฐ์ ๋๋ค. OpenSSL์ด boot2docker ์๋ฒ ์ธ์ฆ์์ ์ ํจ์ฑ์ ๊ฒ์ฌํ๋ ค๊ณ ํ ๋ ์๋ฒ ์ธ์ฆ์๊ฐ ์์ฒด์ ์ผ๋ก ์๋ช ๋ ๊ฒ์ฒ๋ผ ๋ณด์ด์ง๋ง ๋ช ์ ์ ์ผ๋ก ์ ๋ขฐ๋์ง ์์ ์ ํจ ํ ์ ์๊ธฐ ๋๋ฌธ์ CA ์ธ์ฆ์๋ฅผ ๊ณ ๋ คํ์ง ์๊ณ ์์ ํ ์ ๋ขฐ ์ฒด์ธ์ ๊ตฌ์ถ ํ ์ ์์ต๋๋ค. ๋๋ ์ด๊ฒ์ด ์๊ฒฉํ ์ณ๊ฑฐ๋ ์๊ตฌ๋๋ ํ๋์ด๋ผ๊ณ ํ์ ํ์ง ๋ชปํ๋ฉฐ ๊ฒฐ์ ํ ์๊ฒฉ์ด ์์ง๋ง "ํฉ๋ฆฌ์ "์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค.
๋ฐ๊ตด ํด์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค.
๋ํ # 1474๊ฐํ๋ ์ผ์ด ๋๋ฌด ๊ตฌ์ฒด์ ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค. ์ ์ด๋ ๋ด ๋ ์์์ ์ต์ ํ์ด์ฌ ๋ฒ์ ์ ์ค์ ํ๋ ๊ฒ์ด ์๋๋ผ ์ ํํ ๋ฒ์ ์ ์ง์ ํ๋ ๊ฒ์ ๋๋ค. ๋ํ j์ ๋ค๋ฅธ 1.0.1์ด ์๋์ง ํ์ธํ๋ ๋ฐ ์คํจํ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค. ์ด๋ ๋ณด์ ์ ๋ฐ์ดํธ๊ฐ 1.0.1์๋ ์ ์ฉ๋์ง ์๋๋ค๋ ๊ฒ์ ์๋ฏธํ๋ฉฐ ์ด๋ ํ์คํ ๋ฌธ์ ์ ๋๋ค.
๋์ํฉ๋๋ค. boot2docker์ ์ธ์ฆ์์ ๋์ํ์ง ์๋ OpenSSL 1.0.2๋ผ๊ณ ๊ฐ์ ํ๋ฉด ๊ทธ ๋ถ๋ถ์ ์ต์ํ ์์ ๊ฐ๋ฅํด์ผํฉ๋๋ค. ์ต์ OpenSSL 1.0.1 in.
@tdsmith , ์คํด์ ๋ํ ์ค๋ช ๊ณผ ์ฌ๊ณผ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. @glyph , ์ค๋ช ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
FWIW, ๋๋ @tdsmith ์ ์ด๋ก ์ ํ
์คํธํ๋ ค๊ณ ์๋ํ๊ณ Issuer
๋ฐ Subject
๋ํ ๊ณ ์ ํ ๊ฐ์ ์์ฑํ๊ธฐ ์ํด generate_cert
(์ถ์
ํฉ๋๋ค, ์ฉ์ํ์ธ์)๋ฅผ ํ์ฌ generate_cert
์์ ์์ฑ ๋ ์ธ์ฆ์๋ก b2d๋ฅผ ์คํํ ๋ ์ป์ ๊ฒฐ๊ณผ์ ํดํน ๋ ๋ฒ์ ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
0.9.8zd
orig generate_cert
(0.1)์์ ์๋% /usr/bin/openssl version
OpenSSL 0.9.8zd 8 Jan 2015
% /usr/bin/openssl s_client -showcerts -connect "${DOCKER_HOST#tcp:\/\/}" -key "${DOCKER_CERT_PATH}/key.pem" -cert "${DOCKER_CERT_PATH}/cert.pem" -CAfile "${DOCKER_CERT_PATH}/ca.pem" -tls1 </dev/null
depth=1 /O=Boot2Docker
verify return:1
depth=0 /O=Boot2Docker
verify return:1
CONNECTED(00000003)
---
Certificate chain
0 s:/O=Boot2Docker
i:/O=Boot2Docker
-----BEGIN CERTIFICATE-----
MIIC/TCCAeegAwIBAgIRAKt8Sy0ND8z8omBU0uhODVAwCwYJKoZIhvcNAQELMBYx
...
qKFg5oUO9wigoGlwnSjqC/5ZmFRf9B+nWeCUVi/vWl0skOIqCMlDamD8AOVtmtRg
tg==
-----END CERTIFICATE-----
---
Server certificate
subject=/O=Boot2Docker
issuer=/O=Boot2Docker
---
Acceptable client certificate CA names
/O=Boot2Docker
---
SSL handshake has read 2554 bytes and written 2188 bytes
---
New, TLSv1/SSLv3, Cipher is AES256-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : AES256-SHA
Session-ID: 621C9DF6883DA1FAF273408D0C984AC6E1DA33BA44ADA0EBA88BE59490560CFC
Session-ID-ctx:
Master-Key: 39A75DE8551C41241CDBF889A5EF32DC7F86A45C792218B7E380E90627C7D0691BC5FCCAB69154B84142171F866F36C2
Key-Arg : None
TLS session ticket:
0000 - 77 ca 24 b7 2e 33 6a fc-9d 6e d0 eb aa 0d d5 89 w.$..3j..n......
...
0630 - db 49 35 a1 97 .I5..
Start Time: 1438703085
Timeout : 7200 (sec)
Verify return code: 0 (ok)
---
DONE
1.0.2d
(MacPorts๋ฅผ ํตํด ์ค์น๋จ)๋ orig generate_cert
(0.1)์์ ์๋ํ์ง _ ์์ต๋๋ค _.% openssl version
OpenSSL 1.0.2d 9 Jul 2015
% openssl s_client -showcerts -connect "${DOCKER_HOST#tcp:\/\/}" -key "${DOCKER_CERT_PATH}/key.pem" -cert "${DOCKER_CERT_PATH}/cert.pem" -CAfile "${DOCKER_CERT_PATH}/ca.pem" -tls1 </dev/null
depth=0 O = Boot2Docker
verify error:num=18:self signed certificate
verify return:1
depth=0 O = Boot2Docker
verify error:num=21:unable to verify the first certificate
verify return:1
CONNECTED(00000003)
---
Certificate chain
0 s:/O=Boot2Docker
i:/O=Boot2Docker
-----BEGIN CERTIFICATE-----
MIIC/TCCAeegAwIBAgIRAKt8Sy0ND8z8omBU0uhODVAwCwYJKoZIhvcNAQELMBYx
...
qKFg5oUO9wigoGlwnSjqC/5ZmFRf9B+nWeCUVi/vWl0skOIqCMlDamD8AOVtmtRg
tg==
-----END CERTIFICATE-----
---
Server certificate
subject=/O=Boot2Docker
issuer=/O=Boot2Docker
---
Acceptable client certificate CA names
/O=Boot2Docker
Client Certificate Types: RSA sign, ECDSA sign
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 2156 bytes and written 1373 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1
Cipher : ECDHE-RSA-AES256-SHA
Session-ID: BAE02ACF63C2F4E28C46664CEB8E790DB0F00E8CB75913484BFE88CC215995D2
Session-ID-ctx:
Master-Key: C7227519074A26A51D815655721F18C63932897D731D1BF077B8374F8A021D51EDF2E603386D249ED62127BD71A86048
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket:
0000 - 14 b0 7a 58 68 91 62 10-14 53 04 cf da 41 63 6e ..zXh.b..S...Acn
...
0350 - 5f 8e fe fd 9c b0 d0 _......
Start Time: 1438703297
Timeout : 7200 (sec)
Verify return code: 21 (unable to verify the first certificate)
---
DONE
0.9.8zd
์ (๋) ํดํน ๋ generate_cert
(0.1.1; ๋๋์ง ์์)% /usr/bin/openssl s_client -showcerts -connect "${DOCKER_HOST#tcp:\/\/}" -key "${DOCKER_CERT_PATH}/key.pem" -cert "${DOCKER_CERT_PATH}/cert.pem" -CAfile "${DOCKER_CERT_PATH}/ca.pem" -tls1 </dev/null
depth=1 /O=Boot2DockerCA
verify return:1
depth=0 /O=Boot2Docker
verify return:1
CONNECTED(00000003)
---
Certificate chain
0 s:/O=Boot2Docker
i:/O=Boot2DockerCA
-----BEGIN CERTIFICATE-----
MIIC/zCCAemgAwIBAgIRAMLl0tA00F2BDjyktFSD5aEwCwYJKoZIhvcNAQELMBgx
...
jhzP4aW3a8uAdpQXjf8nmJ5Qrq4Xb6yWAezXRdmPWfG1u4neBQKy1Zp64PiBd+0v
1UPu
-----END CERTIFICATE-----
---
Server certificate
subject=/O=Boot2Docker
issuer=/O=Boot2DockerCA
---
Acceptable client certificate CA names
/O=Boot2DockerCA
---
SSL handshake has read 2563 bytes and written 2193 bytes
---
New, TLSv1/SSLv3, Cipher is AES256-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : AES256-SHA
Session-ID: 1E52C9982BE1F98559529B9E804D330ADD5EC8654EE9F3AFE6139B2AEAB24919
Session-ID-ctx:
Master-Key: 0714B120A52F735C484BF0F6612909CEB5FAF27D5E66B3DDB76DCB32FFE506F70E4BC5EFC42BB19E5CBE6223ACEA5803
Key-Arg : None
TLS session ticket:
0000 - c4 54 e0 2f 90 68 f2 22-7a c9 ee 2f fb da 25 7a .T./.h."z../..%z
...
0630 - 5c 95 c6 0a e9 bd 21 70-fd \.....!p.
063a - <SPACES/NULS>
Start Time: 1438703534
Timeout : 7200 (sec)
Verify return code: 0 (ok)
---
DONE
1.0.2d
_works (!) _ : tada : : see_no_evil : : hear_no_evil : : speak_no_evil : ํดํน ๋ generate_cert
(0.1.1)% openssl s_client -showcerts -connect "${DOCKER_HOST#tcp:\/\/}" -key "${DOCKER_CERT_PATH}/key.pem" -cert "${DOCKER_CERT_PATH}/cert.pem" -CAfile "${DOCKER_CERT_PATH}/ca.pem" -tls1 </dev/null
depth=1 O = Boot2DockerCA
verify return:1
depth=0 O = Boot2Docker
verify return:1
CONNECTED(00000003)
---
Certificate chain
0 s:/O=Boot2Docker
i:/O=Boot2DockerCA
-----BEGIN CERTIFICATE-----
MIIC/zCCAemgAwIBAgIRAMLl0tA00F2BDjyktFSD5aEwCwYJKoZIhvcNAQELMBgx
...
jhzP4aW3a8uAdpQXjf8nmJ5Qrq4Xb6yWAezXRdmPWfG1u4neBQKy1Zp64PiBd+0v
1UPu
-----END CERTIFICATE-----
---
Server certificate
subject=/O=Boot2Docker
issuer=/O=Boot2DockerCA
---
Acceptable client certificate CA names
/O=Boot2DockerCA
Client Certificate Types: RSA sign, ECDSA sign
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 2899 bytes and written 2111 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1
Cipher : ECDHE-RSA-AES256-SHA
Session-ID: 0F1A3A0AB7B1E7C1CFD43CED169E730745DEB935C4DBEDDC7CD8AB698ECB8896
Session-ID-ctx:
Master-Key: A48F441FD8677E1602BFB96DC7E9B39D0E9A7241D1C4AF93F3022ACB621C73E16BD69F557FF4428B033B1C07DF5EB0FB
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket:
0000 - 30 e1 e9 1a 4d e0 48 78-14 22 e8 21 5d 84 e7 6f 0...M.Hx.".!]..o
...
0630 - 27 15 8a 64 ff 2e 24 44-3d d8 '..d..$D=.
Start Time: 1438703550
Timeout : 7200 (sec)
Verify return code: 0 (ok)
---
DONE
๋ชจ๋ ๋ณ๊ฒฝ ์ฌํญ์ ์ ์ดํ๊ธฐ ์ํด ์๋ณธ generate_cert
(0.1)์ด ๋ฆด๋ฆฌ์ค๋์์ ๋ ๋น๋์ ์ฌ์ฉ ๋ golang:1.3-cross
Docker ์ด๋ฏธ์ง๊ฐ ํจํค์ง์ ์ก์ธ์ค ํ ์์์ ๋ ๋น๋๋์์ต๋๋ค. ์ ํ ssh
. ํด๋น ํจํค์ง๋ ์ดํ openssh-client
๋ก ๋์ฒด๋์์ต๋๋ค. ํดํน ๋ generate_cert
๋น๋์ ์ฌ์ฉ ๋ OpenSSL ๋ฒ์ ์ 1.0.1k
์
๋๋ค. ์ด๊ฒ์ ์ ์ ์ผ๋ก ์ฐ๊ฒฐ๋ ๊ฒ์ผ๋ก ๋ณด์
๋๋ค.
% ldd generate_cert-0.1.1-linux-amd64
linux-vdso.so.1 (0x00007ffd0936c000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007fddefe7f000)
libc.so.6 => /lib/libc.so.6 (0x00007fddefb11000)
/lib64/ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x00007fddf009a000)
๋ฐ๋ผ์ ๋ค์ ๋ ๊ฐ์ง ์ค ํ๋๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค.
Issuer
== Subject
๋ ํผ๋๋ฉ๋๋ค. ๋๋์ด๊ฒ์ ํ
์คํธํ๋ ํ ๊ฐ์ง ๋ฐฉ๋ฒ์ ๋ด ํดํน์์ด OpenSSL์ ์
๋ฐ์ดํธ ๋ ๋ฒ์ ์ผ๋ก generate_cert
์ ๋ค์ ๋น๋ํ๋ ๊ฒ์
๋๋ค. ๋ค์์ ํ ๊ฒ์.
๊ทธ๋์ @tdsmith ๊ฐ ์ณ์ ๊ฒ ๊ฐ์ต๋๋ค. ํ ๋ด ํดํน์ ๋ฐฑ์
๋ณด์ฅํ๊ธฐ Issuer
<> Subject
,ํ์ง๋ง ์ฌ๊ฑด generate_cert
์์์ OpenSSL ์ต์ ๋ฒ์ ๊ณผ golang:1.3-cross
, ๊ทธ๊ฒ์์ผ๋ก ์คํจ๋ก ๋์ ๊ฐ๋ค ํด๋ผ์ด์ธํธ ์ธก์ ์ต์ OpenSSL ๋ฒ์ :
0.9.8zd
๋ ์
๋ฐ์ดํธ ๋ OpenSSL์ ํตํด generate_cert
(0.1.2)์์ ์๋ํฉ๋๋ค.% /usr/bin/openssl version
OpenSSL 0.9.8zd 8 Jan 2015
% /usr/bin/openssl s_client -showcerts -connect "${DOCKER_HOST#tcp:\/\/}" -key "${DOCKER_CERT_PATH}/key.pem" -cert "${DOCKER_CERT_PATH}/cert.pem" -CAfile "${DOCKER_CERT_PATH}/ca.pem" -tls1 </dev/null
depth=1 /O=Boot2Docker
verify return:1
depth=0 /O=Boot2Docker
verify return:1
CONNECTED(00000003)
---
Certificate chain
0 s:/O=Boot2Docker
i:/O=Boot2Docker
-----BEGIN CERTIFICATE-----
MIIC/TCCAeegAwIBAgIRAIVQ9IAYtPQwnu/FHM8HNS0wCwYJKoZIhvcNAQELMBYx
...
xZ+XhXvepeJ/mBIui1qT3yAMum0Mj1zLAxqCY/qsEU4odsgU9N9DbUGngoIkBCrY
gw==
-----END CERTIFICATE-----
---
Server certificate
subject=/O=Boot2Docker
issuer=/O=Boot2Docker
---
Acceptable client certificate CA names
/O=Boot2Docker
---
SSL handshake has read 2554 bytes and written 2188 bytes
---
New, TLSv1/SSLv3, Cipher is AES256-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : AES256-SHA
Session-ID: FDE088ECF8D0EB2B36EC909B9A66C9C6770AE31355040761CB35150C5A56E92E
Session-ID-ctx:
Master-Key: 86522F869CDE85C8171EEC3A7CF76FDF26F81AE6162DDDEA7D1C55FD5E49E4BDCA56D827C3BFECBFAD9AA2F71A5A94EE
Key-Arg : None
TLS session ticket:
0000 - 67 d0 60 8e 54 54 7c 7a-3e 5e 71 97 26 e0 06 2c g.`.TT|z>^q.&..,
...
0630 - cf 68 86 83 d7 .h...
Start Time: 1438705996
Timeout : 7200 (sec)
Verify return code: 0 (ok)
---
DONE
1.0.2d
(MacPorts๋ฅผ ํตํด ์ค์น๋จ)๋ ์
๋ฐ์ดํธ ๋ OpenSSL์ ์ฌ์ฉํ๋ generate_cert
(0.1.2)์์ ์๋ํ์ง _ ์์ต๋๋ค _.% openssl version
OpenSSL 1.0.2d 9 Jul 2015
% openssl s_client -showcerts -connect "${DOCKER_HOST#tcp:\/\/}" -key "${DOCKER_CERT_PATH}/key.pem" -cert "${DOCKER_CERT_PATH}/cert.pem" -CAfile "${DOCKER_CERT_PATH}/ca.pem" -tls1 </dev/null
depth=0 O = Boot2Docker
verify error:num=18:self signed certificate
verify return:1
depth=0 O = Boot2Docker
verify error:num=21:unable to verify the first certificate
verify return:1
CONNECTED(00000003)
---
Certificate chain
0 s:/O=Boot2Docker
i:/O=Boot2Docker
-----BEGIN CERTIFICATE-----
MIIC/TCCAeegAwIBAgIRAIVQ9IAYtPQwnu/FHM8HNS0wCwYJKoZIhvcNAQELMBYx
...
xZ+XhXvepeJ/mBIui1qT3yAMum0Mj1zLAxqCY/qsEU4odsgU9N9DbUGngoIkBCrY
gw==
-----END CERTIFICATE-----
---
Server certificate
subject=/O=Boot2Docker
issuer=/O=Boot2Docker
---
Acceptable client certificate CA names
/O=Boot2Docker
Client Certificate Types: RSA sign, ECDSA sign
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 2156 bytes and written 1373 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1
Cipher : ECDHE-RSA-AES256-SHA
Session-ID: C2A8BF01E9B754CBF48C69243091C54DAD19DCF52D285C9379B684A3B333AFDD
Session-ID-ctx:
Master-Key: F8510162517AF4C115A13B7CA9E05E04868B4D78CBFA57B28A5B9616EE6FBED6B7B4FC52C2003EBC5D150FA8BDE95F4C
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket:
0000 - bc bc 2c 3e 2d b0 92 49-80 c2 c0 df 4f bd fb 84 ..,>-..I....O...
...
0350 - 1e c7 c2 b2 e6 f5 74 ......t
Start Time: 1438705985
Timeout : 7200 (sec)
Verify return code: 21 (unable to verify the first certificate)
---
DONE
SvenDowideit / generate_cert # 10์ด ํ์ํฉ๋๋ค. ๊ทธ๊ฑด ๊ทธ๋ ๊ณ , ๋๊ตฐ๊ฐ๊ฐ ๋ด ํดํน ๋ generate_cert
๋ฅผ ๊ฐ๋ฆฌํค๋ b2d ์ด๋ฏธ์ง๋ฅผ ๋น๋ํ๊ณ ์ถ๋ค๋ฉด ๊ณต์ ์์ ์ด ๋ฆด๋ฆฌ์ค ๋ ๋๊น์ง ์๋ํด ๋ณผ ์ ์์ต๋๋ค.
๋ด๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ดํดํ๋ค๋ฉด, ์ด๊ฒ์ ํด๋ผ์ด์ธํธ ์ธก์์ OpenSSL / Python ๋ฒ์ ๊ฒ์์ ํ๋ ์ด ํ ํ์์ฑ์ ์์ ์ผํฉ๋๋ค (์ ์ด๋์ด ๋ฌธ์ ์ ๊ด๋ จํ์ฌ).
@SvenDowideit ํ๊ทธ ์ง์
๋๋ OpenSSL ๋ ์๋ค๊ณผ ์ฝ๊ฐ์ ์ ํ ๊ด๊ณ๋ฅผ ๊ฐ์ก์ต๋๋ค. ๋ค์์ Steve Henson์ ์์ฝ์ ๋๋ค.
From: Stephen Henson via RT <[email protected]>
Subject: [openssl.org #3979] New OpenSSL issue: valid certificate fails validation where subject text == issuer text
Date: August 5, 2015 at 04:32:18 PDT
Cc: [email protected]
Reply-To: [email protected]
... The bug is that OpenSSL 1.0.2 is less strict about
what counts as a valid self signed certificate. Before 1.0.2 the certificate
had to have issuer and subject matching, if present AKID==SKID and
keyUsage (if present) had to include keyCertSign. For1.0.2 and later the
keyCertSign check is no longer present.
The attached patch should fix it. Let me know if it works for you.
A workaround (other than making subject != issuer) is to include SKID/AKID in
all certificates.
Regards, Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
๋ฒ๊ทธ๊ฐ์๋ OpenSSL ํด๋ผ์ด์ธํธ๋ฅผ ์์ฉํ๊ธฐ ์ํด b2d๊ฐ ์ธ์ฆ์๋ฅผ ์์ฑํ๋ ๋ฐฉ์์ ๋ณ๊ฒฝํ๋ ๊ฒ์ ํด๋ผ์ด์ธํธ ์ธก์์ OpenSSL์ ํจ์นํ๊ณ ์ค์นํ๋ ๊ฒ๋ณด๋ค ํจ์ฌ ์ฐ์ํฉ๋๋ค. ๊ทธ๋๋ ์ด๋ค ํน์ ์ ๊ทผ ๋ฐฉ์์ด ๋ ์ ์ ํ ์ง ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค (์ฃผ์ ๋ฅผ ๋ง๋๋ ๊ฒ = ๋ฐ๊ธ์ ๋ ๋ชจ๋ ์ธ์ฆ์์ SKID / ADID ํฌํจ). ๋๋ ๊ทธ ๋ฒ ์ @SvenDowideit์ ๋๊ธธ ๊ฒ์ด๋ค. : ์์ :
๊ถ๊ธํ์ ๋ถ๋ค์ ์ํด (๋ค์ ๋ง์ ๋๋ฆฌ์ง๋ง,์ด ๋ฐฉ๋ฒ์ ์ฌ์ฉํด์๋ ์๋๋ค๊ณ ์๊ฐํฉ๋๋ค) ๋ค์์ Steve์ OpenSSL ํจ์น์ ๋๋ค.
diff --git a/crypto/x509v3/v3_purp.c b/crypto/x509v3/v3_purp.c
index 1f9296a..7a0130a 100644
--- a/crypto/x509v3/v3_purp.c
+++ b/crypto/x509v3/v3_purp.c
@@ -63,6 +63,7 @@
#include <openssl/x509_vfy.h>
static void x509v3_cache_extensions(X509 *x);
+static int check_ca(const X509 *x);
static int check_ssl_ca(const X509 *x);
static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x,
@@ -493,7 +494,7 @@ static void x509v3_cache_extensions(X509 *x)
if (!X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x))) {
x->ex_flags |= EXFLAG_SI;
/* If SKID matches AKID also indicate self signed */
- if (X509_check_akid(x, x->akid) == X509_V_OK)
+ if (X509_check_akid(x, x->akid) == X509_V_OK && check_ca(x) == 1)
x->ex_flags |= EXFLAG_SS;
}
x->altname = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);
์ ์ฒด ๊ธฐ๋ก : http://rt.openssl.org/Ticket/History.html?user=guest&pass=guest&id=3979.
์ ๊น ... _less_ ์๊ฒฉํ? ๋ ์๊ฒฉํ ๊ฒ์ฌ๊ฐ ํต๊ณผํ๋ ๊ณณ์์ _less_ ์๊ฒฉํ ๊ฒ์ฌ๊ฐ ์ด๋ป๊ฒ ์คํจํฉ๋๊น?
์ ๊น ... _less_ ์๊ฒฉํ? ๋ ์๊ฒฉํ ๊ฒ์ฌ๊ฐ ํต๊ณผํ๋ ๊ณณ์์ _less_ ์๊ฒฉํ ๊ฒ์ฌ๊ฐ ์ด๋ป๊ฒ ์คํจํฉ๋๊น?
๋ค, ๊ทธ ์ธ์ด ์ ํ์๋ ๋ฌธ์ ๊ฐ์์์ต๋๋ค. ์ฐจ์ด์ ์ ์ดํด๋ณด๋ฉด, ๊ทธ๋ ๋ง์ ๊ฒ์ฌ๋ฅผ ์ํํ์ง ์์์ผ๋ก์จ ์์ฒด ์๋ช ๋ ์ธ์ฆ์๋ก ๋ ๋ง์ ์ธ์ฆ์๋ฅผ ์๋ชป ์ธ์ด ๋ฒ๋ฆฌ๋ ๊ฒ์ ์๋ฏธํ๋ค๊ณ ์๊ฐํฉ๋๋ค (์ฆ, ์์ฒด ์๋ช ๋ ๊ฒ์ผ๋ก ๊ฐ์ฃผ๋์ง _ ์๋ _ ๊ฒฐ์ ํ๋ ๋ฐ ๋ ์๊ฒฉํจ). ํ์ง๋ง ๋น์ ๋ง์ด ๋ง์์. ์ด์ํ ๊ตฌ์ ์ ๋๋ค.
๋๋ OpenSSL ์์ค๋ฅผ ํ๊ตฌํ๋ ๋ฐ ๊ทธ๋ค์ง ๋ง์ ์๊ฐ์ ์๋นํ์ง ์์์ง๋ง ๋ง์ ๊ณณ์์ ๊ทธ๊ฒ๋ค์ ์๋นํ ๋ซ์ ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค. ํด๋น ํ๋ก์ ํธ๋ฅผ ์ํํ๋ ค๋ฉด "ํน๋ณํ"์ฌ๊ณ ๋ฐฉ์์ด ํ์ํ ์ ์์ต๋๋ค. :์ด๋ฅผ ๋๋ฌ๋ด๊ณ ์๋ค:
๋๋ OpenSSL ์์ค๋ฅผ ํ๊ตฌํ๋ ๋ฐ ๊ทธ๋ค์ง ๋ง์ ์๊ฐ์ ์๋นํ์ง ์์์ง๋ง ๋ง์ ๊ณณ์์ ๊ทธ๊ฒ๋ค์ ์๋นํ ๋ซ์ ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค. ํด๋น ํ๋ก์ ํธ๋ฅผ ์ํํ๋ ค๋ฉด "ํน๋ณํ"์ฌ๊ณ ๋ฐฉ์์ด ํ์ํ ์ ์์ต๋๋ค.
๊ณผ์ ํํ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค : wink :.
์ด์จ๋ OpenSSL ์ง์์๊ฒ ๋ฌธ์ ํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ์ฌ๊ธฐ์์ ํด๊ฒฐ ๋ ๊ฒ์ ๋๋ค. ํํธ, b2d์์ ์์ ํ๋ ๊ฒ์ด ์ณ์ ์ผ์ฒ๋ผ ๋ณด์ ๋๋ค. compose๊ฐ ์ฌ๊ธฐ์ ํ ์ผ์ด ์๋ค๊ณ ์๊ฐํ์ง๋ง ๊ธฐ๋ค๋ฆฌ์ญ์์ค.
์ฌ๊ธฐ ์์ ์ธ๊ธํ๋ฏ์ด ์ด๊ฒ์ ๋๋ฅผ ์ํด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํฉ๋๋ค.
pip install requests[security]
@iffy ๊ทธ๊ฒ์ ๋ถ์ ์ฒญ์ด์ ๋๋ค; ๋ค๋ฅธ OpenSSL์ ๋งํฌ ๋ ์บ์ ๋ ๋ฐ์ด๋๋ฆฌ ํ ์ด ์์๊ธฐ ๋๋ฌธ์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์ต๋๋ค.
์ฐธ๊ณ ๋ก, ์์ ์ฌํญ์ด ํฌํจ ๋ PR์ด boot2docker / boot2docker # 1029๋ก ์ ์ถ๋์์ต๋๋ค.
์ด์ ๋ํ ์์ ์ฌํญ (@posita์๊ฒ ๊ฐ์ฌ๋๋ฆฝ๋๋ค!)์ ์ต์ ๋ฒ์ ์ boot2docker์ ์์ต๋๋ค. ์ ๊ทธ๋ ์ด๋ํ๋ ค๋ฉด :
$ boot2docker upgrade
$ boot2docker delete
$ boot2docker init
$ boot2docker up
๊ทธ๊ฒ์ ๋๋ฅผ ์ํด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค. ๊ทธ๊ฒ์ ์๋ํ๊ณ ๋ค์๋ณด๊ณ ํ์ญ์์ค.
๋๋ ์๋ก์ด Docker Toolbox์ ์ผ๋ถ๋ก ํ์ค์ผ๋ก ์ ๊ณต๋๋ Docker Machine์ผ๋ก ์ ํํ์ญ์์ค.
์ฌ์ ํ์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค ...
โฏ openssl version && docker-compose --version && docker-machine --version && python --version
OpenSSL 1.0.2d 9 Jul 2015
docker-compose version: 1.4.0
docker-machine version 0.4.1 (HEAD)
Python 2.7.10
โฏ docker-compose ps
/usr/local/Cellar/fig/1.4.0/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Name Command State Ports
------------------------------
@chiefy ๋์ปค ์์ฑ ํธ์ถ์ด ์ฑ๊ณตํ์ต๋๋ค. ๋น์ ์ด๋ณด๊ณ ์๋ ๊ฒฝ๊ณ ๋ ๋ฌดํดํฉ๋๋ค. ๋ณด์ง ์์ผ๋ ค๋ฉด OS X 10.10.5๋ก ์ ๊ทธ๋ ์ด๋ํด์ผํฉ๋๋ค.
@tdsmith ๋ ๋์๊ฒ ๋ฌดํดํ์ง ์์ผ๋ฉฐ, ๋ด OCD๋ฅผ ๋ฏธ์น๊ฒ
brew๋ฅผ ํตํด ์ค์น๋ ํ์ด์ฌ ๋ฒ์ ์ ์ ๊ฑฐํ๋ฉด์ด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค. brew remove --force python
Brew ๋ฒ์ ์ ์ ๊ฑฐํ์ง๋ง ์ฌ์ ํ Python 2.7.10
์๊ณ ์ฌ์ ํ
SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
์ค๋ฅ.
๋ค์ ์ค์ ์ด ์์ต๋๋ค.
OpenSSL 0.9.8zg 14 July 2015
docker-compose version: 1.4.0
docker-machine version 0.4.1 (e2c88d6)
Python 2.7.10
ํ
๋ฌธ์ ๋ฅผ ํด๊ฒฐ ํ์ต๋๊น?
docker-compose ์ฌ๋๋ค์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ๋ ธ๋ ฅํ๊ณ ์๋์ง ์๋๋ฉด ๊ธฐ๋ณธ์ ์ผ๋ก ๋ฌธ์ ๊ฐ ์๋์ง ์๊ณ ์์ต๋๊น?
๋ฌธ์ ์ธ์ฌ,
์๋
ํ์ธ์.
์๋. ๋ Mac (10.9.x ๋ฐ 10.10.x)์์ ๋ณ๊ฒฝ์์ด ๋ค์ํ ์์
์ ์๋ํ์ต๋๋ค. ๋๋ ์ด๊ฒ์ด docker-compose
์ผ์ด๊ณ ํ์ด์ฌ ์ผ FWIW์ ๋ ๋ง์ ๊ฒ์ด๋ผ๊ณ ์๊ฐํ์ง ์์ต๋๋ค.
ํ
๋์ํ์ง๋ง ์๋ํ๋ ๋ฐฉ๋ฒ์ ๋ํ ๋ณํ์ ์ฐพ์ง ๋ชปํ์ต๋๋ค.
๋ชจ๋ ์ฌ๋์ด ์ด๋ฏธ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐ ํ ๊ฒ ๊ฐ์ง๋ง ์ ๋ ์๋๋๋ค. :)
brew๋ฅผ ์ฌ์ฉํ์ฌ ํ์ด์ฌ์ ํ ๋ฒ ์ค์นํ๋๋ฐ ์์คํ ํ๋๋ฅผ ์ ๊ฑฐํ ๊ฒ ๊ฐ์์ ์ด์ ๋ฒ์ ์ผ๋ก ๋์๊ฐ ์์๋ ์ต์ ์ด ์์ต๋๋ค.
์ฌ๋ฌ ๋ณํ์ผ๋ก ๋์ปค๋ฅผ ์ค์นํ๋ ค๊ณ ์๋ํ์ต๋๋ค.
๊ทธ๋ฌ๋ ๋๋ ์ฌ์ ํ ๊ฐ์ง๊ณ ์์ต๋๋ค.
๋๊ตฌ๋ ์ง์ด ํ๋์ ๊ทน๋ณตํ๋ ๋ฐฉ๋ฒ์ ๋ํ ํฌ๊ด์ ์ธ ๊ฐ์ด๋๊ฐ ์์ต๋๊น?
๋ฌธ์ ์ธ์ฌ,
@PavelPolyakov- ๋ฒ๊ทธ๋ boot2docker (๊ทธ๋ฆฌ๊ณ ์ด๋ค ๊ฒฝ์ฐ์๋ docker-machine)๊ฐ ํ์ด์ฌ์ SSL ์ง์์ผ๋ก ์ฌ์ฉํ ์์๋ ์ผ๋ถ ์ธ์ฆ์๋ฅผ ๊ตฌ์ถํ๊ณ ์๋ค๋ ๊ฒ์
๋๋ค. ๋ชจ๋ ์ํํธ์จ์ด๋ฅผ ์
๊ทธ๋ ์ด๋ํ์ง๋ง ์ฌ์ ํ ์๋ชป๋ ์ค๋๋ ์ธ์ฆ์๊ฐ ์์ผ๋ฉด ๋ฌธ์ ๊ฐ ๊ณ์ ๋ฐ์ํฉ๋๋ค. ๋ฐ๋ผ์์ด ์์ ์์ ํ์ฌ ๋ฒ์ ์ docker-machine์ ์ฌ์ฉํ์ฌ ๋ณด์ ํ ๋ชจ๋ dev VM์ ๋ค์ ํ๋ก๋น์ ๋ํ์ฌ ์ SSL ์ธ์ฆ์๊ฐ ํ๋ก๋น์ ๋๋๋๋กํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ์ฌ๊ธฐ์๋ ํธ์คํธ์์ ~/.docker
์์ผ๋ก ์ด๋ํ๋ ๊ฒ์ด ํฌํจ๋ ์ ์์ต๋๋ค.
@PavelPolyakov ๋ฐ @chiefy , @glyph ์ ์กฐ์ธ ์ธ์๋ ๋ค์์ ์๋ํด ๋ณผ ์ ์์ต๋๋ค ( boot2docker
ํ๊ฒฝ์ ์์ ํ ์ฌ ํ๋ก๋น์ ๋ํ๊ณ ์ถ์ง ์์ ๊ฒฝ์ฐ).
% mv ~/.docker ~/.docker.bak
% ssh docker@[boot2dockerip]
docker@[boot2dockerip]'s password: [typically "tcuser"]
...
Boot2Docker version 1.8.1, build master : 7f12e95 - Thu Aug 13 03:24:56 UTC 2015
Docker version 1.8.1, build d12ea79
docker<strong i="10">@boot2docker</strong>:~$ rm -frv ~/.docker
...
docker<strong i="11">@boot2docker</strong>:~$ sudo -s
root<strong i="12">@boot2docker</strong>:/home/docker# rm -v /var/lib/boot2docker/tls/*
...
root<strong i="13">@boot2docker</strong>:/home/docker# shutdown -h now
...
[boot2dockerip]
๋ VM ํ๊ฒฝ์ ๋ฐ๋ผ ๋ค๋ฆ
๋๋ค. ๋ ์ฌ์ด ๋ฐฉ๋ฒ์ด์์ ์ ์์ต๋๋ค (์ : Vagrant๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ vagrant ssh
). ๊ทธ๋ฐ ๋ค์ boot2docker
์ธ์คํด์ค๋ฅผ ๋ค์ ์์ํ๊ณ SSL ์ค๋ฅ๊ฐ ๊ณ์ ๋ฐ์ํ๋์ง ํ์ธํฉ๋๋ค.
@glyph
์กฐ์ธ์ ํด์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ๋์๊ฒ๋ ๋์ปค ๋จธ์ ์ ์ฌ ํ๋ก๋น์ ๋ํ๋ ๊ฒ์ด ๋ฌธ์ ๊ฐ ์๋๋๋ค. ๊ทธ๋ฌ๋ ๊ทธ๊ฒ์ ๋์์ด๋์ง ์์ต๋๋ค.
docker & co๋ฅผ ์ค์นํ ๋ :
brew install docker docker-machine docker-compose
๊ทธ๋ฌ๋ฉด default
๋จธ์ ์ด ์์ฑ๋์ง ์์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ docker-machine create
์ฌ์ฉํ์ฌ ๋ง๋๋ ๋ฐฉ๋ฒ์ ๋ชจ๋ฆ
๋๋ค.
* .pkg ํ์ผ์ ์ฌ์ฉํ์ฌ docker-toolbelt๋ฅผ ์ค์นํ๋ฉด ๋จธ์ ์ด ์์ฑ๋์ง๋ง SSL ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
๋๋ ์ฌ์ง์ด ์๋ํ๋ค :
docker-machine regenerate-certs default
๊ทธ๋ฌ๋ ๊ทธ๊ฒ์ ๋์์ด๋์ง ์์ต๋๋ค.
@posita
์กฐ์ธ์ ํด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค.
๊ทํ์ ๊ฐ์ด๋์์ mv ~/.docker ~/.docker-bak
์๊ฒ ์ ์ํ๋ ์ด์ ๋ ๋ฌด์์
๋๊น? ์ด๋ ๊ฒํ๋ฉด ํ์ผ์ด ์ด๋๋๊ธฐ ๋๋ฌธ์ ์์คํ
์ ๋ค์ ์์ํ ์ ์์ต๋๋ค.
์, ์ปดํจํฐ์ ๋ก๊ทธ์ธํ์ฌ tls/*
๋ฅผ ์ ๊ฑฐํ ๋ค์ ์ข
๋ฃ ํ ์ ์์ง๋ง ๋ค์ ์์ํ๋ ๋ฐฉ๋ฒ์ ๋ฌด์์
๋๊น?
์ฒ์๋ถํฐ ๋ค์ ํ๋ก๋น์ ๋ํ๋ ๋ฐฉ๋ฒ์ ๋ฌด์์ ๋๊น?
@๋ชจ๋
docker๋ฅผ ์ค์นํ๋ ๋ฐฉ๋ฒ์ ๋ฌด์์
๋๊น (docker-compose ์๋์ผ๋ก), brew install
๋๋ toolbelt .pkg๋ฅผ ํตํด์
๋๊น?
๋ด docker-machine์์๋ ์ธ์ฆ์๊ฐ ํ์ด์ฌ์์ ์ ํจํ๊ณ ์ ์ฉํ๋ค๋ ๊ฒ์ ์ด๋ป๊ฒ ํ์ ํ ์ ์๋์ง, ์ด๋ป๊ฒ brew๊ฐ ํ ์์๋ ๊ฒ๋ณด๋ค ๋ ๋ง์ด ํ์ด์ฌ๊ณผ openssl์ ์
๊ทธ๋ ์ด๋ ํ ์ ์์ต๋๊น?
๋์ ๊ฐ์ฌํฉ๋๋ค.
๋ฌธ์ ์ธ์ฌ,
@PavelPolyakov- docker-machine
์๋ "๊ธฐ๋ณธ"์ปดํจํฐ๋ผ๋ ๊ฐ๋
์ด ์์ต๋๋ค. docker-machine create --driver virtualbox my-docker-machine
์คํํ ์ ์์ต๋๋ค.
@PavelPolyakov ์ผ๋จ ์๋ฃ๋๋ฉด eval "$(docker-machine env my-docker-machine)"
๋๋ ๋ก์ปฌ ๊ฐ๋ฐ ์์คํ
์ ํธ์ถํ๊ธฐ ์ํด ์ ํํ ๋ชจ๋ ์์
์ ์ํํด์ผํฉ๋๋ค.
@glyph
๋ง์ต๋๋ค. brew
์์ ๋ชจ๋ ๊ฒ์ ์คํํ๋ ๊ณผ์ ์์ ๋น ์ง ๋ถ๋ถ์ด์์ต๋๋ค. ์ด๋ฆ์ด default
๋จธ์ ์ ์ฑ๊ณต์ ์ผ๋ก ํ๋ก๋น์ ๋ํ์ต๋๋ค (* .pkg์์ ์ค์นํ๋ ๋์ ์ํ ํ ๊ฒ๊ณผ ๋์ผ).
๊ทธ๋ฌ๋ ํ์์ ๊ฐ์ด ๋๋ฉ๋๋ค.
:(
๊ฐ์ด๋์์ ~ / .docker ~ / .docker-bak-์ด๋ค ์ด์ ๋ก? ์ด๋ ๊ฒํ๋ฉด ํ์ผ์ด ์ด๋๋๊ธฐ ๋๋ฌธ์ ์์คํ ์ ๋ค์ ์์ํ ์ ์์ต๋๋ค.
@PavelPolyakov , ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ๋๋ docker-machine
์ฌ์ฉํ์ง ์์ต๋๋ค. ๋ค๋ฅธ ํ๊ฒฝ์ ๋ฐํ์ผ๋ก ์ถ์ธกํ๊ณ ์์์ต๋๋ค. ์ด๊ฒ์ด ์๋ํ์ง ์์ผ๋ฉด ๋ฌด์ํ์ญ์์ค.
์, ์์คํ ์ ๋ก๊ทธ์ธํ์ฌ
tls/*
๋ฅผ ์ ๊ฑฐํ ๋ค์ ์์คํ ์ ์ข ๋ฃ ํ ์ ์์ง๋ง ๋ค์ ์์ํ๋ ๋ฐฉ๋ฒ์ ๋ฌด์์ ๋๊น?
docker-machine restart
์ด ์๋ํ์ง ์์ต๋๊น?
๋ด ์๊ฒฌ์ Vagrant์ ํจ๊ป boot2docker
์ (๋ฅผ) ์คํ ํ ๊ฒฝํ์ ๋ฐํ์ผ๋ก ์์ฑ๋์์ต๋๋ค. docker-machine
์ ์ ์ฉ๋์ง ์์ ์ ์์ต๋๋ค. @glyph ๊ฐ ํด๋น ํ๊ฒฝ์ ๋ํด ๋ ๋ง์ ๊ฒฝํ์ ๊ฐ์ง๊ณ ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋๋ ๊ทธ์ ์ ์์ ์๋ ํ ๊ฒ์
๋๋ค.
docker๋ฅผ ์ค์นํ๋ ๋ฐฉ๋ฒ์ ๋ฌด์์ ๋๊น (docker-compose ์๋),
brew install
๋๋ toolbelt .pkg๋ฅผ ํตํด?
์ด๊ฒ์ ์ด๋ ์ ๋ ์ธ๋ถ (์ ์ธ์ฆ์ ๋ฌธ์ ๋ฅผ ๊ตฌ์ฒด์ ์ผ๋ก ๋ค๋ฃจ๋์ด ๋ฌธ์ ์ ๋ฒ์ ์ธ boot2docker
์ ๋ํ๋ ๋ฐ์ ๊ฐ์ด docker-compose
)ํ์ง๋ง, OS X์์, ๋ด๊ฐ ์ฌ์ฉํ๋ ๋ฐ์ด๋๋ฆฌ ๋น๋ .
@PavelPolyakov , ๋ค์์ ์ํํ๋ฉด ์ด๋ป๊ฒ๋ฉ๋๊น?
docker-machine create --driver virtualbox shiny-new-machine-74d5a19e
eval $( docker-machine env shiny-new-machine-74d5a19e )
docker-compose build
๋ค์์ ์ํ ํ ๋ ํ์๋๋ boot2docker
์ ๋ฒ์ ์ ๋ฌด์์
๋๊น?
docker-machine ssh shiny-new-machine-74d5a19e
shiny-new-machine-74d5a19e
๋ ๊ธฐ์กด ์ธ์คํด์ค๋ฅผ ์ฐธ์กฐํ์ง ์๋ ํ ์ํ๋๋๋ก ์์ ๋กญ๊ฒ ๋ฐ๊ฟ ์ ์์ต๋๋ค (์ฆ, ์ ๋ช
๋ น์ ์คํํ๊ธฐ ์ ์ docker-machine ls
๋ฅผ ์ํ ํ ๋ ์ด๋ฆ์ด ํ์๋์ง ์์์ผํฉ๋๋ค .).
@posita
ํ .... : ํผ๋ : @PavelPolyakov , ์ด๊ฒ์ด ๋น์ ์๊ฒ ๋ฌด์์ ์ ๊ณตํฉ๋๊น?
eval $( docker-machine env shiny-new-machine-74d5a19e ) # probably unnecessary if you're still in the same shell as above
which openssl
openssl s_client -showcerts -connect "${DOCKER_HOST#tcp:\/\/}" -key "${DOCKER_CERT_PATH}/key.pem" -cert "${DOCKER_CERT_PATH}/cert.pem" -CAfile "${DOCKER_CERT_PATH}/ca.pem" -tls1 </dev/null
@posita
๊ณ์ ๋์ ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค.
openssl s_client -showcerts -connect "${DOCKER_HOST#tcp:\/\/}" -key "${DOCKER_CERT_PATH}/key.pem" -cert "${DOCKER_CERT_PATH}/cert.pem" -CAfile "${DOCKER_CERT_PATH}/ca.pem" -tls1 </dev/null
http://pastebin.com/Y9ZqfTVG
๋ค๋ฅธ OSX ์์คํ
์์ ๋์ผํ ์์
์ ์๋ํ์ต๋๋ค.
๋ชจ๋ ์ต์ ์
๋ฐ์ดํธ (os ๋ฐ brew ํจํค์ง)์ ํจ๊ป SSL๊ณผ ๋์ผํ ๋ฌธ์ ์ ์ง๋ฉดํ์ต๋๋ค.
@PavelPolyakov , ์ ๋ openssl s_client ...
๋คํ์์ ์ด๊ฒ์๋ณด๊ณ ์์ต๋๋ค :
...
Certificate chain
0 s:/O=shiny-new-machine-74d5a19e
i:/O=PavelPolyakov
...
๋ค์์ boot2docker
๊ธฐ๋ณธ๊ฐ์ด ์๋๋ฉฐ (ํ์ฌ) ๋ค์๊ณผ ๊ฐ์์ผํฉ๋๋ค.
...
Certificate chain
0 s:/O=Boot2Docker
i:/O=Boot2Docker
...
๋ ๋ง์ ๊ฒ์ ์์ง ๋ชปํด๋ docker-machine
๊ฐ ๊ฐ์ ๋จธ์ ์ ํ๋ก๋น์ ๋ ํ ๋ ๊ธฐ๋ณธ๊ฐ์ ๋ฎ์ด ์ฐ๋ ๊ฒ ๊ฐ์ต๋๋ค. ๊ทธ๋ฌ๋ openssl
ํธ์ถ์ด ํจ๊ณผ๊ฐ์๋ ๊ฒ์ผ๋ก ๋ณด์ด๋ฏ๋ก ์ด๊ฒ์ด ๋ฌธ์ ์ธ์ง ํ์คํ์ง ์์ผ๋ฉฐ docker-compose
์ด ์คํจํ๋ ์ด์ ๋ฅผ ์ดํดํ ์ ์์ต๋๋ค. : ํผ๋ :
๋ค์์ ๋ํ ๊ฒฐ๊ณผ๋ ๋ฌด์์ ๋๊น?
(
set -x
eval $( docker-machine env shiny-new-machine-74d5a19e )
env | grep DOCKER
ls -al "${DOCKER_CERT_PATH}"
openssl x509 -in "${DOCKER_CERT_PATH}/cert.pem" -text
openssl x509 -in "${DOCKER_CERT_PATH}/ca.pem" -text
docker-compose --verbose version
docker-compose --verbose ps
DOCKER_TLS_VERIFY=0 docker-compose --verbose ps
) >"${HOME}/Desktop/docker-compose-890-outerr-$( date -u +%Y-%m-%dT%H:%M:%SZ ).txt" 2>&1
๋ถ์ฌ ๋ฃ๊ธฐ / ์
๋ก๋์ ์ ํฉํ ~/Desktop/docker-compose-890-outerr-2015-09-18T14:45:29Z.txt
์ ๊ฐ์ ํ์ผ์ด ์์ฑ๋ฉ๋๋ค.
@posita
์ฌ๊ธฐ์์ด:
http://pastebin.com/vWqZgVKi
์ด๊ฒ์ด ๊ทํ์ ๋ฌธ์ ์ ๊ด๋ จ์ด ์๋ค๊ณ ํ์ ํ์ง๋ง docker-compose
๋ฐ docker-py
๋ฒ์ ์ด ๋ค์ณ์ ธ ์์ต๋๋ค. ๋ค์์ ์ต์ ๋ฆด๋ฆฌ์ค์
๋๋ค.
...
docker-compose version: 1.4.1
docker-py version: 1.4.0
...
๋ํ (์ด๊ฒ์ ์๋ชป ์ฝ์์ ์๋ ์์ต๋๋ค) ca.pem
๋ฐ cert.pem
์ด (๊ฐ) ๋์ผํ Subject
(์๋ณธ boot2docker
์ ์์ธ์ด ๋จ)์ ๊ณต์ ํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ฌธ์ ์ด์ง๋ง ๋ค๋ฅธ ๋ฐฉํฅ์์ ์ค๋ ๊ฒ). ์ด๋ฌํ ์ธ์ฆ์๋ docker-machine
์ํด ์์ฑ / ์ ์ง๋๋ ๊ฒ์ผ๋ก ๋ณด์ด๋ฏ๋ก ๋ฌธ์ ๊ฐ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋์ปค / ๋จธ์ # 1335์ ๋์ปค / ๋จธ์ # 1767์ ์ฐพ์๋๋ฐ, ๊ด๋ จ์ด์์ ์ ์์ง๋ง ๋ ๋ค ์ง์ ์ง์ ์ ์์ง ์์ ๊ฒ ๊ฐ์ต๋๋ค.
, ๋ด๊ฐ ์ฌ์ฉ FWIW docker-compose
(๋ฅผ ํตํด ์ค์น pip
A์ virtualenv
OpenSSL์ํ๊ณ MacPorts๋ฅผ์์ ์ค์น ํ ํ์ด์ฌ 2.7 ํฌํจ). ํด๋น ๋ฒ์ ์ OpenSSL์์ด ๋ฌธ์ ์์ ํ์ธ ๋ ๋ฌธ์ ์ ์ํฅ์๋ฐ์ต๋๋ค ( boot2docker
์
๋ฐ์ดํธ๋ก boot2docker
1.8.1+ ๋ฐ Vagrant์์ ๋ฌธ์ ์์ด ์๋ํฉ๋๋ค ( Vagrantfile
๋ ์ผ๋ถ ํ๋ก๋น์ ๋ ๋ง๋ฒ์ ํตํด boot2docker
์ธ์ฆ์๋ฅผ ํธ์คํธ๋ก ๋ค์ ๋ณต์ฌํฉ๋๋ค).
% cat /.../Vagrantfile
...
# See <http://tinyurl.com/nz4tgy6>
boot2docker.vm.provision :shell, inline: "set -e ; while ! docker >/dev/null ps --quiet ; do echo 'Waiting for Docker to come alive so we can kill it...' ; sleep 1 ; done ; sudo /etc/init.d/docker stop ; sudo rm -f /var/lib/boot2docker/tls/*.pem ~docker/.docker/*.pem ; sudo /etc/init.d/docker restart ; while ! docker >/dev/null ps --quiet ; do echo 'Waiting for Docker to come alive again so we can steal its keys...' ; sleep 1 ; done ; echo 'It lives!' ; [ -z \"$( find ~docker/.docker -name '*.pem' 2>/dev/null )\" ] || cp -Rv ~docker/.docker/*.pem '/vagrant/certs" , privileged: true
...
% env | grep DOCKER
DOCKER_HOST=tcp://w.x.y.z:2376
DOCKER_TLS_VERIFY=1
DOCKER_CERT_PATH=/.../certs
% ls "${DOCKER_CERT_PATH}"
ca.pem
cert.pem
key.pem
% openssl x509 -in "${DOCKER_CERT_PATH}/cert.pem" -text
...
Issuer: O=Boot2DockerCA
...
Subject: O=Boot2Docker
...
% openssl x509 -in "${DOCKER_CERT_PATH}/ca.pem" -text
...
Subject: O=Boot2DockerCA
...
% virtualenv --python=python2.7 .../venv
...
% .../venv/bin/pip install docker-compose
...
% .../venv/bin/docker-compose --verbose version
docker-compose version: 1.4.1
docker-py version: 1.4.0
CPython version: 2.7.10
OpenSSL version: OpenSSL 1.0.2d 9 Jul 2015
% .../venv/bin/docker-compose ps
Name Command State Ports
------------------------------
๊ทธ ์ ํ๊ถ์ด ์์ ์๋ ์๋ค๋ ๊ฒ์ ์๊ณ ์์ต๋๋ค. ๋ฌธ์ ๋ฅผ ์ง๋จํ๋ ๋ฐ ๋์์ด ๋ ์์๋ ์ฐจ์ด์ ์ ์ค๋ช
ํ๊ธฐ ์ํด ๊ฒ์ํ๋ ๊ฒ์
๋๋ค. ์์ docker-machine
์์ฑ ๋ ์ธ์ฆ์์ ๋น๊ตํ์ญ์์ค.
+-zsh:39> openssl x509 -in /.../.docker/machine/machines/shiny-new-machine-74d5a19e/cert.pem -text
...
Issuer: O=PavelPolyakov
...
Subject: O=PavelPolyakov
...
+-zsh:40> openssl x509 -in /.../.docker/machine/machines/shiny-new-machine-74d5a19e/ca.pem -text
...
Subject: O=PavelPolyakov
...
ca.pem
Subject
์ ca.pem
๋ cert.pem
์ Subject
๊ณผ ๋์ผํฉ๋๋ค.
๊ทํ์ ๋ฌธ์ ๊ฐ docker-compose
์ ๋ฌธ์ ๋ผ๊ณ ์๊ฐํ์ง ์์ต๋๋ค. ( @aanand , ์๋ง๋ ๋๊ธ์ ๋ฌ ์ ์์ต๋๊น?)์ด ๋ฌธ์ ๊ฐ ์ผ๋ง๋ ๋ณต์กํด ์ก๋์ง ํ์ธ ํ๊ณ docker / machine์ ๋ํ ์๋ก์ด ๋ฌธ์ ๋ฅผ ์ ์ถํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ๋๋ ๊ทํ์ ์ด๊ธฐ ์๊ฒฌ ์์ ์์ํ์ฌ ์ด๊ฒ์ ์ฐธ์กฐ ํ ๊ฒ์
๋๋ค.
docker / machine์ ๋ํ ์๋ก์ด ๋ฌธ์ ๋ฅผ ์ ์ถํ๊ธฐ๋ก ๊ฒฐ์ ํ ๊ฒฝ์ฐ VM ์ธ์คํด์ค์ /var/log/docker.log
๋๋ /var/log/boot2docker.log
์์ ํฅ๋ฏธ๋ก์ด ํญ๋ชฉ์ ์ถ๊ฐํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ์๋ฅผ ๋ค์ด ๋ค์์ ์๋ํ์ญ์์ค.
ssh docker@[machine-instance] grep generate_cert /var/log/boot2docker.log
๋๋:
docker-machine ssh grep generate_cert /var/log/boot2docker.log
OSX el capitain์์ ์ด๊ฒ์ ์ป๊ณ ,
docker-machine version 0.4.1 (HEAD)
Docker version 1.8.2, build 0a8c2e3
docker-compose version: 1.4.2
์๋ ํ์ธ์ @DaveBlooman ,
๊ถ๊ธํ ์ ์ด ์์ต๋๋ค. brew๋ฅผ ์ฌ์ฉํ์ฌ Python ๋ฐ ๊ธฐํ ํญ๋ชฉ๋ ์ค์น๋์ด ์์ต๋๊น? ์๋๋ฉด ๋ค๋ฅธ ๋ฐฉ๋ฒ์ผ๋ก.
๊ทธ๋ฆฌ๊ณ docker-compose build
ํ ๋ ์ ํํ ์ค๋ฅ๊ฐ ์์ต๋๊น?
homebrew๋ฅผ ํตํด Python 2.7.10
๋ฐ๋ผ์ brew
๋๋ฌธ์ ํ์คํ ๋ฌด์ธ๊ฐ๊ฐ ๋ฐ์ํฉ๋๋ค :(
@DaveBlooman , docker / machine # 1910 ์ฐธ์กฐ. @PavelPolyakov ์ ๋ฌธ์ ๋ฅผ ์ฌํ ํ ์ ์๋ค๋ฉด ๋ ์ฌ๋์ด ์ง๋จ์ ํ๋ ฅ ํ ์ ์์๊น์?
๋๋ ๋๊ฐ์ ๋ฌธ์ ๊ฐ ์์๊ณ ๋ค๋ฅธ ์์ฉ ํ๋ก๊ทธ๋จ (์ ๊ฒฝ์ฐ์๋ Astrill)์ ์ํด VPN ์ฐ๊ฒฐ์ด ์ด๋ ค ์์๊ธฐ ๋๋ฌธ์ ๋คํธ์ํฌ ๊ตฌ์ฑ์ ๋ฌธ์ ๊ฐ ์์์ ๊ฒ์ ๋๋ค. ์ด๊ฒ์ด ๊ฐ์ ๋ฌธ์ ๋ฅผ ๊ฐ์ง ๋ค๋ฅธ ์ฌ๋์ ๋์ธ ์ ์๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
OSX 10.9.5์์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
/usr/local/Cellar/docker-compose/1.5.0/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Starting compose_maven_1
/usr/local/Cellar/docker-compose/1.5.0/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Starting compose_ssh_1
/usr/local/Cellar/docker-compose/1.5.0/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
ํ์ด์ฌ 2.7.10
docker-machine ๋ฒ์ 0.5.0
docker-compose ๋ฒ์ : 1.5.0
๋ชจ๋ Homebrew๋ฅผ ํตํด ์ค์น๋จ
@anthonygreen , ๊ทธ๊ฒ์ ์ค์ง์ ์ผ๋ก ๋ค๋ฅธ ๋ฌธ์ ์ฒ๋ผ ๋ณด์ ๋๋ค. ์ฌ๊ธฐ์ ๋ ผ์๋๋ ๊ฒ๊ณผ ๋์ผํ ์ค๋ฅ ๋ฉ์์ง๊ฐ ํ์๋์ง ์์ต๋๋ค. Homebrew ์ฌ์ฉ์๋ ์ด์ ๊ด๋ จ๋์ง ์์ ๋ง์ ๋ฌธ์ ๋ฅผ ๊ฒฝํํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ์๋ก์ด ๋ฌธ์ ์ ์ถ์ ๊ณ ๋ คํ์ญ์์ค.
์ด ์ ์ฒด ๊ฒ์๋ฌผ์ ์ฝ์ง ์์์ง๋ง Docker Toolbox 1.9.1a๋ฅผ ์ฌ์ฉํ๋ OS X Yosemite์ ์ต๊ทผ ์ค์ ์์ ๋์ผํ ์ค๋ฅ๋ฅผ ๋ณด์์ต๋๋ค.
$ docker-machine --version
docker-machine version 0.5.1 (7e8e38e)
$ docker-compose --version
docker-compose version: 1.5.1
$ docker --version
Docker version 1.9.1, build a34a1d5
์ฌ์ฉ์ ์ง์ CURL_CA_BUNDLE
ํ๊ฒฝ ๋ณ์ ์ธํธ (์ผ๋ถ ์ฌ์ฉ์ ์ง์ ๋ด๋ถ ์ธ์ฆ์ ํฌํจ)๊ฐ ์๊ณ docker-compose
๋ฅผ ์คํํ๊ธฐ ์ ์์ด ํ๊ฒฝ ๋ณ์๋ฅผ ์ค์ ํด์ ํ๋ฉด [SSL: CERTIFICATE_VERIFY_FAILED]
์ค๋ฅ๋ฅผ ํต๊ณผ ํ ์ ์์ต๋๋ค.
$ (unset CURL_CA_BUNDLE; docker-compose up)
Starting ...
ํธ์ง : ์ฃ์กํฉ๋๋ค, ์ฌ๊ธฐ์ ์ฃผ์์๋ค๋ ์๋ฏธ https://github.com/docker/machine/issues/1880
@pmahoney , ์ฐ๋ฆฌ์๊ฒ ์๋ ค ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค! ๋๋ ๊ทธ๊ฒ์ ๊ฒฐ์ฝ ์ง์ํ์ง ๋ชปํ์ ๊ฒ์ ๋๋ค. ์ฐธ๊ณ ๋ก ๋ค์๊ณผ ๊ฐ์ด ํ ์๋ ์์ต๋๋ค (์๋ธ ์์ ์ํ์ง ์๋ ๊ฒฝ์ฐ).
$ CURL_CA_BUNDLE= docker-compose up
@posita env var๋ฅผ ๋น ๋ฌธ์์ด๋ก ์ค์ ํ๋ฉด ๊ฒฝ๊ณ ๊ฐ ๋ฐ์ํฉ๋๋ค.
$TMPDIR/requests/packages/urllib3/connectionpool.py:768: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
SSL ์ค๋ฅ๊ฐ ๋ฐ์ํ์ง ์์ง๋ง.
@pmahoney , ํฅ๋ฏธ ๋กญ์ต๋๋ค. ๋ฐ๋ผ์ set-but-empty CURL_CA_BUNDLE
์ ์ ํ ์ค์ ํ์ง ์๋ ๊ฒ๊ณผ ๋ค๋ฅธ ์๋ฏธ (์ฆ, null ์ฌ์ ์)๋ฅผ ๊ฐ์ง๊ณ ์๋ ๊ฒ์ฒ๋ผ ๋ณด์
๋๋ค (์๋ง๋ ๊ธฐ๋ณธ ์์น๋ก ๋ณด์). ๋ฌธ์์ ๋์์์ ์ด๊ฒ์ ์ฐพ์ผ๋ ค๊ณ ํ์ง๋ง ์ฑ๊ณตํ์ง ๋ชปํ์ต๋๋ค. ๋ด๊ฐ ์ฐพ์ ๊ฐ์ฅ ๊ฐ๊น์ด ๊ฒ์ ์ด๊ฒ ์
๋๋ค.
@neilsarkar ๋ด ๋ฌธ์ ๋ Charles ํ๋ก์๋ ์คํ ์ค์ด์์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค!
์ค ์ธ์์, ํ ์คํธํ๋ ๋ ์ปดํจํฐ ๋ชจ๋์ ์ปค์คํ CURL_CA_BUNDLE์ด ์์ต๋๋ค.
๊ฐ์ฌ
๋๋ฅผ ์ํด ์๋ฌด๊ฒ๋, CURL_CA_BUNDLE ๋ณ์๊ฐ ์์ต๋๋ค :(
๊ทธ๋์ ๋๋ ๊ทธ๊ฒ์ ์ฑ๊ณตํ์ง ๋ชปํ ๊ฐ์ผ๋ก ์ค์ ํ๋ ค๊ณ ์๋ํ์ง๋ง CURL_CA_BUNDLE์ ์๋ฌด๊ฒ๋ ์ค์ ํ์ง ์์ผ๋ฉด (CURL_CA_BUNDLE =) @pmahoney๊ฐ ๋งํ ๊ฒ์ฒ๋ผ ๊ฒฝ๊ณ ๊ฐ ํ์๋๊ณ ์๋ํ์ง๋ง ํฐ๋ฏธ๋์ ๊ฒฝ๊ณ ๋ฉ์์ง๋ก ์์ ํ ํํธ๋ฌ์ก์ต๋๋ค.
๋ ๋์ ํด๊ฒฐ์ฑ
์ด ์๊ธฐ๋ฅผ ๋ฐ๋๋๋ค. :)
CURL_CA_BUNDLE ๋ณ์์ ๋ํ ์ข์ ๊ฐ์ด ๋ฌด์์ธ์ง ์๊ณ ์๋ค๋ฉด ๊ทธ๊ฒ์ ์ทจํฉ๋๋ค. :)
๊ณ ๋ง์
webkit-patch์ ๊ฐ์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. SSL / TLS ๋ชจ๋ ์ ssl.get_default_verify_paths()
๋ Python / OpenSSL์ด CA ์ธ์ฆ์ ํ์ผ์ ์์ํ๋ ์์น๋ฅผ ๋ณด์ฌ์ค๋๋ค. ๋ฐ๋ผ์ ํฐ๋ฏธ๋์์ ์ด๊ฒ์ ์คํํ๋ฉด :
python3 -c "import ssl; [print(i) for i in ssl.get_default_verify_paths()]"
SSL_CERT_FILE
๊ฐ ์ค์ ๋์ง ์์ ์ํ์์ Python์ SSL ๋ชจ๋์ /usr/local/ssl/cert.pem
CA ์ธ์ฆ์ ํ์ผ์ ์์ํฉ๋๋ค (OpenSSL์ /usr/local/ssl
์ค์น ํ ์ฌ์ฉ์์ ๊ฒฝ์ฐ). ๋ฐ๋ผ์ SSL_CERT_FILE
๋ฅผ ๋ฃจํธ CA ์ธ์ฆ์๊ฐ์๋ ์ธ์ฆ์ ํ์ผ๋ก ์ค์ ํ๊ฑฐ๋ ๋ฃจํธ CA ์ธ์ฆ์๊ฐ์๋ ํ์ผ์ /usr/local/ssl/cert.pem
ํฉ๋๋ค. ๋ฃจํธ CA ์ธ์ฆ์๊ฐ ํ์ํ ๊ฒฝ์ฐ curl
๋ค์ด๋ก๋ํ๊ณ ์์ค ํธ๋ฆฌ์์ lib/mk-ca-bundle.pl
๋ฅผ ์คํํ๋ฉด ca-bundle.crt ํ์ผ์ด ์์ฑ๋ฉ๋๋ค. SSL_CERT_FILE
์ด Python 2.7.11 ๋ฐ Python 3.5.0๊ณผ ํจ๊ป OpenSSL 1.0.2d์์ ์๋ํ๋์ง ํ์ธํ ์ ์์ต๋๋ค.
@grahamc ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์
จ์ต๋๊น? ์๊ฒฉ ๋์ปค ๋ฐ๋ชฌ์์๋ ์ ์๋ํ์ง๋ง docker-compose
์์๋ ์คํจํ๋ ๋น์ทํ ์ค์ ์ด ์์ต๋๋ค.
๋ด๊ฐ ์ป๋ ์ค๋ฅ๋ ERROR: SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
์๋์, ๋ถํํ๋ ์๊ฒฉ ๋์ปค ํธ์คํธ๋ฅผ ๋ฒ๋ ค์ผํ์ต๋๋ค.
๋ฐฉ๊ธ CURL_CA_BUNDLE
์ธํด docker-compose
๊ฐ ์คํจํ๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค.
ERROR: SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
docker
์ (๋) ์ ์๋ํ์ต๋๋ค. docker-compose
ํ๊ฒฝ ๋ณ์๋ฅผ ๋ฌด์ํ๋๋กํ๊ฑฐ๋ ์ต์ํ ์์ ์ธ์ฆ์๋ฅผ ์ฌ์ฉํ์ง ์์ ๊ฒ์ด๋ผ๋ ๊ฒฝ๊ณ ๋ฅผ ๊ธฐ๋กํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
@buckett , ์๋ก์ด ๋ฌธ์ ๋ฅผ ์ ์ถํ์ฌ ๊ธฐ๋ฅ ์์ฒญ์ผ๋ก ์ถ๊ฐํ๋ ๊ฒ์ ๊ณ ๋ คํ์ญ์์ค. docker-py
๋ก ์๋งค ๋ฌธ์ ๋ฅผ ์ ์ถํ๊ณ ์๋ก ์ฐธ์กฐํ๋๋กํ๋ ๊ฒ๋ ๊ณ ๋ คํด๋ณด์ญ์์ค. ์ด๋ค ๋ ์ด์ด๊ฐ ๊ฐ์ฅ ์ ํฉํ ์ง ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.
ํธ์ง : ์๋ก์ด ๋ฌธ์ # 3114 ์์ฑ
๋ชจ๋์ด ๋ฌธ์ ๋ฅผ ์์ง ๊ณ ์ณค์ต๋๊น? ์ฌ์ ํ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค. ๋ด docker-compose version
:
docker-compose version 1.6.2, build 4d72027
docker-py version: 1.7.2
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1j 15 Oct 2014
์ด๊ฒ์ docker-compose --verbose build
์์ ์ป์ ๊ฒ์
๋๋ค.
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: File doesn't exist
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "compose/cli/main.py", line 56, in main
File "compose/cli/docopt_command.py", line 23, in sys_dispatch
File "compose/cli/docopt_command.py", line 26, in dispatch
File "compose/cli/main.py", line 189, in perform_command
File "compose/cli/command.py", line 52, in project_from_options
File "compose/cli/command.py", line 85, in get_project
File "compose/cli/command.py", line 68, in get_client
File "site-packages/docker/api/daemon.py", line 78, in version
File "site-packages/docker/utils/decorators.py", line 47, in inner
File "site-packages/docker/client.py", line 112, in _get
File "site-packages/requests/sessions.py", line 477, in get
File "site-packages/requests/sessions.py", line 465, in request
File "site-packages/requests/sessions.py", line 573, in send
File "site-packages/requests/adapters.py", line 431, in send
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
Docker์ ๋๊ตฌ ์์๋ฅผ ํตํด docker, docker-mahine ๋ฐ docker-compose๋ฅผ ์ค์นํ์ต๋๋ค.
์์ ๋ชจ๋ ์ ์์ ์๋ํ์ง๋ง ์ด์ด ์์ต๋๋ค. docker
์ ๋ํ ๊ฒฝํ์ด ์์ด์ ์ค์ค๋ก ์์๋ผ ์ ์์์ต๋๋ค.
๋๊ตฌ๋ ์ง ์ด๊ฒ์ ๋ํ ๊ทผ๋ณธ ์์ธ์ด๋ ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ์์ต๋๊น? ์ต์ openssl ๋ฒ์ ์ผ๋ก ์์ฑ 1.7.0์์๋ณด๊ณ ์์ต๋๋ค.
์ด๊ฒ์ ๋ชจ๋ ์ํ์ธ์์ ๋น๋๋๊ณ ์คํ๋๋ฏ๋ก ํ๊ฒฝ์ ์์ํด์ผํฉ๋๋ค.
/usr/src/app # env | sed 's/DOCKER_HOST=.*/DOCKER_HOST=#redacted/' && docker version && docker ps && docker-compose version && docker-compose pull
HOSTNAME=aebfe81b5938
SHLVL=1
PYTHON_PIP_VERSION=8.1.1
HOME=/root
GPG_KEY=97FC712E4C024BBEA48A61ED3A5CA953F73C700D
DOCKER_TLS_VERIFY=1
TERM=xterm
DOCKER_CERT_PATH=/certs
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LANG=C.UTF-8
PYTHON_VERSION=3.5.1
DOCKER_HOST=#redacted
PWD=/usr/src/app
Client:
Version: 1.10.3
API version: 1.22
Go version: go1.5.3
Git commit: 20f81dd
Built: Thu Mar 10 21:49:11 2016
OS/Arch: linux/amd64
Server:
Version: 1.10.3
API version: 1.22
Go version: go1.5.3
Git commit: 20f81dd
Built: Thu Mar 10 15:39:25 2016
OS/Arch: linux/amd64
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
docker-compose version 1.7.0, build 0d7bf73
docker-py version: 1.8.0
CPython version: 3.5.1
OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
Pulling registry (registry:2)...
ERROR: SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
๋ฟก๋ฟก
์ ๊ฒฝ์ฐ์๋ ์ฌ์ ์ ๋ CURL_CA_BUNDLE
env ๋ณ์๋ก ์ธํด ๋ฐ์ํ์ต๋๋ค. ๊ทธ๋ฐ ๊ฒฝ์ฐ๋ ์๋์ง ํ์ธํด์ผํฉ๋๋ค.
@PavelPolyakov๋ ๋ด ํ๊ฒฝ ๋คํ๋ฅผ ํ์ธํ์ญ์์ค ... CURL_CA_BUNDLE ์์
@PavelPolyakov ์์์ด ์ด๊ฒ์ ์ด์ํ๋ค. ๋ด ํ๊ฒฝ์ ์์ง ์๋๋ผ๋ env ๋ณ์๋ฅผ ๋ช ์ ์ ์ผ๋ก ์ค์ ํด์ ํ๊ณ ์๋ํ์ต๋๋ค.
@jmmills ํ ...
์์คํ
ํ์ด์ฌ์ ์ฌ์ฉํ๋ Mac OS, homebrew docker-compose ๋ฐ docker-machine. ์๋ก ์์ฑ ๋ ๋จธ์ : docker-machine create --driver=vmwarefusion --vmwarefusion-memory-size 1536 dev
env | grep CURL
์ ์๋ฌด๊ฒ๋ ๋ฐํํ์ง ์์ต๋๋ค.
docker-compose ps
๋ฐํ
์ค๋ฅ : SSL ์ค๋ฅ : ํธ์คํธ ์ด๋ฆ '172.16.129.133'์ด 'localhost'์ ์ผ์นํ์ง ์์ต๋๋ค.
CURL_CA_BUNDLE='' docker-compose ps
๋ฐํ :
/usr/local/Cellar/docker-compose/1.7.0/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:768: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
/usr/local/Cellar/docker-compose/1.7.0/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:768: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
Name Command State Ports
------------------------------
๋๋ ๋๊ฐ์ ๊ฒ์ ๊ฐ์ง๊ณ ์์๋ค- CURL_CA_BUNDLE
๋ ๋ด ํ๊ฒฝ์ ์ค์ ๋์ง ์์๊ณ ๋น ๋ฌธ์์ด๋ก ์ค์ ํ๋ฉด @inanimatt์ ๋์ผํ ์ถ๋ ฅ์ ์ป์์ต๋๋ค.
ํ์คํ ์ ์คํธ๋ฆผ ๋ฒ๊ทธ์ฒ๋ผ ๋์๊ฐ๋ฉ๋๋ค. ์ ์๊ฐ์๋ "์ ์ ๋จ"๊ณผ "๋น์ด ์์"์ด ๋ค๋ฅด๊ฒ ์ทจ๊ธ๋๋ curl์ ๋ํ ํ๊ฒฝ ํธํ์ฑ ์ฝ๋๊ฐ ์์ต๋๋ค.
๊ฐ์ฌ,
์ ์ด์จ ๋ฐ์ค
2016 ๋ 4 ์ 24 ์ผ ์ค์ 6:14์ Alex Wilson [email protected] ์ ๋ค์๊ณผ ๊ฐ์ด ์ผ์ต๋๋ค.
๋๋ ๋๊ฐ์ ๊ฒ์ ๊ฐ์ง๊ณ ์์๋ค-CURL_CA_BUNDLE์ด ๋ด ํ๊ฒฝ์ ์ค์ ๋์ง ์์๊ณ ๊ทธ๊ฒ์ ๋น ๋ฌธ์์ด๋ก ์ค์ ํ๋ฉด @inanimatt์ ๋์ผํ ์ถ๋ ฅ์ ์ป์์ต๋๋ค.
โ
๋น์ ์ด ์ธ๊ธ ๋์๊ธฐ ๋๋ฌธ์ ์ด๊ฒ์ ๋ฐ๊ณ ์์ต๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.
homebrew ๋ฒ์ ์๋ง ์ํฅ์ ๋ฏธ์น๋ ๊ฒ ๊ฐ์ต๋๋ค. homebrew Python์ ์ค์น ํ ๋ค์ pip๋ฅผ ํตํด docker-compose๋ฅผ ์ค์นํ๋ฉด ๋ชจ๋ ์ค๋ฅ๊ฐ ํด๊ฒฐ๋ฉ๋๋ค.
2016 ๋ 4 ์ 24 ์ผ 14:14์ Alex Wilson [email protected] ์ ๋ค์๊ณผ ๊ฐ์ด ์ผ์ต๋๋ค.
๋๋ ๋๊ฐ์ ๊ฒ์ ๊ฐ์ง๊ณ ์์๋ค-CURL_CA_BUNDLE์ด ๋ด ํ๊ฒฝ์ ์ค์ ๋์ง ์์๊ณ ๊ทธ๊ฒ์ ๋น ๋ฌธ์์ด๋ก ์ค์ ํ๋ฉด @inanimatt์ ๋์ผํ ์ถ๋ ฅ์ ์ป์์ต๋๋ค.
โ
๋น์ ์ด ์ธ๊ธ ๋์๊ธฐ ๋๋ฌธ์ ์ด๊ฒ์ ๋ฐ๊ณ ์์ต๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.
์ด์ ์ Linux์์ ๋ฌธ์ ์ ๋ณต์ ๋ฅผ ๋ถ์ฌ ๋ฃ์๋ค๊ณ ์๊ฐํฉ๋๋ค. ๋ด์ผ ์ํฌ ์คํ ์ด์ ์์ ๋ค์ ํ์ธํ ์ ์์ต๋๋ค.
๊ฐ์ฌ,
์ ์ด์จ ๋ฐ์ค
2016 ๋ 4 ์ 24 ์ผ ์คํ 12์ 22 ๋ถ์ Matt Robinson [email protected] ์ ๋ค์๊ณผ ๊ฐ์ด ์ผ์ต๋๋ค.
homebrew ๋ฒ์ ์๋ง ์ํฅ์ ๋ฏธ์น๋ ๊ฒ ๊ฐ์ต๋๋ค. homebrew Python์ ์ค์น ํ ๋ค์ pip๋ฅผ ํตํด docker-compose๋ฅผ ์ค์นํ๋ฉด ๋ชจ๋ ์ค๋ฅ๊ฐ ํด๊ฒฐ๋ฉ๋๋ค.
2016 ๋ 4 ์ 24 ์ผ 14:14์ Alex Wilson [email protected] ์ ๋ค์๊ณผ ๊ฐ์ด ์ผ์ต๋๋ค.
๋๋ ๋๊ฐ์ ๊ฒ์ ๊ฐ์ง๊ณ ์์๋ค-CURL_CA_BUNDLE์ด ๋ด ํ๊ฒฝ์ ์ค์ ๋์ง ์์๊ณ ๊ทธ๊ฒ์ ๋น ๋ฌธ์์ด๋ก ์ค์ ํ๋ฉด @inanimatt์ ๋์ผํ ์ถ๋ ฅ์ ์ป์์ต๋๋ค.
โ
๋น์ ์ด ์ธ๊ธ ๋์๊ธฐ ๋๋ฌธ์ ์ด๊ฒ์ ๋ฐ๊ณ ์์ต๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.โ
๋น์ ์ด ์ธ๊ธ ๋์๊ธฐ ๋๋ฌธ์ ์ด๊ฒ์ ๋ฐ๊ณ ์์ต๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.
brew๋ฅผ ์ฌ์ฉํ์ฌ docker-compose๋ฅผ ๋ฒ์ 1.7๋ก ์ ๋ฐ์ดํธ ํ ์ดํ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค.
$ docker-compose ps
ERROR: SSL error: hostname '192.168.99.100' doesn't match 'localhost'
$ docker-compose version
docker-compose version 1.7.0, build unknown
docker-py version: 1.8.0
CPython version: 2.7.10
OpenSSL version: OpenSSL 0.9.8zh 14 Jan 2016
CURL_CA_BUNDLE ํ๊ฒฝ ๋ณ์ ์ข ๋ฅ๋ฅผ ๋น์ฐ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋ฉ๋๋ค.
CURL_CA_BUNDLE= docker-compose ps
/opt/boxen/homebrew/Cellar/docker-compose/1.7.0/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:768: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
/opt/boxen/homebrew/Cellar/docker-compose/1.7.0/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:768: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
/opt/boxen/homebrew/Cellar/docker-compose/1.7.0/libexec/vendor/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:768: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
Name Command State Ports
------------------------------------------------------------
1.6.2๋ก ๋ค์ด ๊ทธ๋ ์ด๋ํด๋ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋ฉ๋๋ค.
$ brew switch docker-compose 1.6.2
Cleaning /opt/boxen/homebrew/Cellar/docker-compose/1.4.2
Cleaning /opt/boxen/homebrew/Cellar/docker-compose/1.5.1
Cleaning /opt/boxen/homebrew/Cellar/docker-compose/1.5.2
Cleaning /opt/boxen/homebrew/Cellar/docker-compose/1.6.0
Cleaning /opt/boxen/homebrew/Cellar/docker-compose/1.6.2
Cleaning /opt/boxen/homebrew/Cellar/docker-compose/1.7.0
3 links created for /opt/boxen/homebrew/Cellar/docker-compose/1.6.2
$ docker-compose ps
Name Command State Ports
------------------------------------------------------------
CURL_CA_BUNDLE์ ๋นํ์ฑํํ๋ ๋์ ๋ค์์ ์ฌ์ฉํ์ฌ ์คํํ ์ ์์ต๋๋ค.
CURL_CA_BUNDLE = ~ / .docker / machine / machines / default / ca.pem docker-compose ps
๋ด๊ฐ ์ด๊ฒ์ ์ฒ์์ผ๋ก ์ ๊ธฐ ํ ์ฌ๋์ ์๋ ์ ์์ง๋ง curl ํ๊ฒฝ ๋ณ์๊ฐ ๊ด๋ จ์๋ Python ์ ํ๋ฆฌ์ผ์ด์ ์ ์ด๋ค ์ํฅ์ ๋ฏธ์น๋์ง ์ง๊ด์ ์ด์ง ์์ต๋๊น?
๊ฐ์ฌ,
์ ์ด์จ ๋ฐ์ค
2016 ๋ 5 ์ 7 ์ผ ์คํ 3:22์ Lorenzo Sicilia [email protected] ์ ๋ค์๊ณผ ๊ฐ์ด ์ผ์ต๋๋ค.
CURL_CA_BUNDLE์ ๋นํ์ฑํํ๋ ๋์ ๋ค์์ ์ฌ์ฉํ์ฌ ์คํํ ์ ์์ต๋๋ค.
CURL_CA_BUNDLE = ~ / .docker / machine / machines / default / ca.pem docker-compose psโ
๋น์ ์ด ์ธ๊ธ ๋์๊ธฐ ๋๋ฌธ์ ์ด๊ฒ์ ๋ฐ๊ณ ์์ต๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ฑฐ๋ GitHub์์ ํ์ธํ์ธ์.
์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ณ ๋ฌธ์ ๋ ์์ฒด ์๋ช ๋ ์ธ์ฆ์์ ์ฌ์ฉ์ ์ง์ ์์น๋ฅผ ๊ฐ๋ฆฌํค๋ REQUESTS_CA_BUNDLE ํ๊ฒฝ ๋ณ์์์์์ต๋๋ค. ๋๊ตฌ์๊ฒ๋ ๋์์ด๋ฉ๋๋ค.
@aboutlo ์๋ํฉ๋๋ค-๋ค๋ฅธ ca.pem
ํ์ผ์์๋ ์๋ํ์ง ์์ ์ผ๋ฉฐ์ด ํ์ผ์์๋ง ์๋ํฉ๋๋ค. ๋๋ ๋ํ Windows๋ฅผ ์ฌ์ฉํ๊ณ ์์ผ๋ฏ๋ก ๋ ๋ง์ ๋ถ๋ ๊ตฌ์ฑ์ด ์์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค!
ndg-httpsclient (pip ํฌํจ-๋ฒ์ 0.4.0)๋ฅผ ์ ๊ฑฐํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค. https://github.com/docker/compose/issues/3365์์ ๋ด ๊ฒ์๋ฌผ์ ์ฐธ์กฐํ์ญ์์ค.
docker-compose ๋ฐ docker-py๋ฅผ ๋๋ฒ๊น ํ๊ณ ๋ช ๋ น์์ ํ๊ฒฝ ๋ณ์ ๋ ์ต์ ์ ์ฌ์ฉํด์ผํ๋ค๋ ๊ฒ์ ์์ ๋์ต๋๋ค. ์ด๊ฒ๋ค์ ์์ด์๋ ์๋ฉ๋๋ค. ๋ช ๋ น์ --tls๋ฅผ ์ง์ ํ๋๋ผ๋ ์ด์ TLSConfig ๊ฐ์ฒด๊ฐ ๋ช ๋ น ์ต์ ์์ ์์ ํ ์์ฑ๋๊ณ ํ๊ฒฝ ๋ณ์์์ ์์ฑ ๋ TFSConfig ๊ฐ์ฒด๋ฅผ ์๋ํ๋ฏ๋ก ๋ชจ๋ ์ต์ ์ TLSConfig ๊ฐ์ฒด๋ก ์ง์ ํด์ผํฉ๋๋ค.
@ m-housh OMG ๊ทธ ํ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค! ๋์๊ฒ๋ ๋๊ฐ์ ์ผ์ด ์ผ์ด๋ฌ์ต๋๋ค! ๋ด ํ๊ฒฝ์์ REQUESTS_CA_BUNDLE
์ ์ ๊ฑฐํ๊ณ ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค. ์ฒ์์๋ OpenSSL ๋ฒ์ ์ฐจ์ด ๋๋ฌธ์ (Pyhton์ 1.0.2์ด์ง๋ง OS๋ 0.9.8) ๋ ๋ค 1.0.2๋ก ๋ง๋ค์์ง ๋ง ์ฌ์ ํ ์๋ํ์ง ์์์ต๋๋ค.
๋จ์ํ Docker์ ssh๋ฅผ ์ฌ์ฉํ์ฌ ๋ฌธ์ ๋ฅผ ํด๊ฒฐ ํ ๋ค์ ์ธ์ฆ ๋ ํค์์ ๋ด ์ธ์ฆ์๋ฅผ ํ์ธํ๊ณ ์
๋ฐ์ดํธํฉ๋๋ค. ํฅ๋ฏธ๋กญ๊ฒ๋ ์ด๋ป๊ฒ ๋ ์๋ชป๋ ์ธ์ฆ์์์ต๋๋ค.
๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ญ์์ค.
boot2docker ssh
docker<strong i="10">@boot2docker</strong>:~$ cat .ssh/authorized_keys
์ด ์ธ์ฆ์๊ฐ ์ค์ ๋ก ์ปดํจํฐ์ ์ธ์ฆ์์ธ์ง ํ์ธํ์ญ์์ค. ๋น์ ์ ํ์ผ์์ด ํ์ผ์ ๋ณต์ฌํ๊ณ ์ ์ฅํ์ญ์์ค. ๊ทธ๋ฐ ๋ค์ ์คํํ์ญ์์ค.
docker-compose up
์ด๊ฒ์ ๋๋ฅผ ์ํด ์ผํ์ผ๋ฉฐ ๋์์ด๋๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
๋ฌธ์ ๊ทธ๋ฃจ๋ฐ : โโ์ฌ๊ธฐ์ ์ค๋ช ๋ ๋ค์ํ ์ค๋ฅ ๋ชจ๋ ๋ฐ ์ฌ์ฉ์ ์ค๋ฅ / ์๋ชป๋ ๊ตฌ์ฑ ์๋๋ฆฌ์ค (๋๋ถ๋ถ ์ด๋ ฅ)๊ฐ์๋ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค.
compose์์ ํ์ฌ ์งํ์ค์ธ ๋ฌธ์ ๋ฅผ ๊ฐ๋ฆฌํค๋ ๊ฒ์ผ๋ก ๋ณด์ด๋ ํญ๋ชฉ์ด ์์ผ๋ฏ๋ก ๋ฌธ์ ๋ฅผ ์ข ๋ฃํ๊ฒ ์ต๋๋ค. ๋น์ ์ ์ฌ์ ํ ํ๋์ ์ธ ๋ฒ์ ๊ด๋ จ ์ค๋ฅ๋ฅผ๋ณด๊ณ ์๋ ๊ฒฝ์ฐ ๋ฑ ์๋๋ฆฌ์ค์ ์์ธํ ๋ด์ฉ๊ณผ ์๋ก์ด ๋ฌธ์ ๋ฅผ์ฌ์ญ์์ค
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋ด๊ฐ ์ด๊ฒ์ ์ฒ์์ผ๋ก ์ ๊ธฐ ํ ์ฌ๋์ ์๋ ์ ์์ง๋ง curl ํ๊ฒฝ ๋ณ์๊ฐ ๊ด๋ จ์๋ Python ์ ํ๋ฆฌ์ผ์ด์ ์ ์ด๋ค ์ํฅ์ ๋ฏธ์น๋์ง ์ง๊ด์ ์ด์ง ์์ต๋๊น?
๊ฐ์ฌ,
์ ์ด์จ ๋ฐ์ค