dockerのメモリを下げる カレンダー連携⑤

· ☕ 2

昨日はメモリ不足でdocker動かなかったので、今日はそのリベンジ。

私のPCが7年前のおんぼろのせいで、dockerが要求しているメモリが確保できない問題ww

dockerが要求しているメモリを下げる方法を考える

前回までの流れはこちら

メモリ減らす!

update

updateしてみた。

結果変わらず…。

やはりsettingsにadvancedはない。

アンインストール&最新インストール

結果変わらず…。

やはりsettingsにadvancedはない。

アーカイブをさがす

結構探したけど見つからず…。

エッジ版を入れる

でた!

設定

起動する

$ docker version
Client:
 Version:           18.09.7
 API version:       1.39
 Go version:        go1.10.1
 Git commit:        2d0083d
 Built:             Fri Aug 16 14:20:06 2019
 OS/Arch:           linux/amd64
 Experimental:      false
Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?

ありゃりゃ…。

また出来なくなっちゃった…。

~/.bashrcおかしくなったかな…。

1
export DOCKER_HOST=tcp://localhost:2375

入ってるけどな…。

色々調べる…。

1
2
3
export DOCKER_HOST=tcp://localhost:2375
alias docker="DOCKER_HOST=${DOCKER_HOST} docker"
alias docker-compose="docker-compose -H ${DOCKER_HOST}"

でなんか出てきたから、設定を追加してみるw

$ docker stats
CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT   MEM %               NET I/O             BLOCK I/O           PIDS

動いたww わぁい//

ビルド

改めて…ビルド!

$ docker build .
Sending build context to Docker daemon  3.072kB
Step 1/4 : FROM lambci/lambda:build-python3.8
build-python3.8: Pulling from lambci/lambda
3b0280105a32: Pull complete 
838e4ce9589f: Pull complete 
743fd1cfe265: Pull complete 
558555681a77: Pull complete 
Digest: sha256:9004ec2c2724a19024f7180431b70845db46e1774c009d149d03380cafa8c143
Status: Downloaded newer image for lambci/lambda:build-python3.8
 ---> 841c3a9e9bbe
Step 2/4 : ENV AWS_DEFAULT_REGION ap-northeast-1
 ---> Running in c246a0fc14a0
Removing intermediate container c246a0fc14a0
 ---> 9051088345c5
Step 3/4 : ADD . .
 ---> 142a7073ec21
Step 4/4 : CMD pip3 install -r requirements.txt -t /var/task
 ---> Running in a594923a7f9c
Removing intermediate container a594923a7f9c
 ---> d6262f103a5c
Successfully built d6262f103a5c

う、動いたー!!!!

嬉しい///

ラン

$ docker run docker-layers:1.0
Collecting httplib2
  Downloading httplib2-0.17.0-py3-none-any.whl (95 kB)
Collecting oauth2client
  Downloading oauth2client-4.1.3-py2.py3-none-any.whl (98 kB)
Collecting google-api-python-client
  Downloading google-api-python-client-1.7.11.tar.gz (142 kB)
Collecting pyasn1>=0.1.7
  Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Collecting six>=1.6.1
  Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting rsa>=3.1.4
  Downloading rsa-4.0-py2.py3-none-any.whl (38 kB)
Collecting pyasn1-modules>=0.0.5
  Downloading pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Collecting google-auth>=1.4.1
  Downloading google_auth-1.11.2-py2.py3-none-any.whl (76 kB)
Collecting google-auth-httplib2>=0.0.3
  Downloading google_auth_httplib2-0.0.3-py2.py3-none-any.whl (6.3 kB)
Collecting uritemplate<4dev,>=3.0.0
  Downloading uritemplate-3.0.1-py2.py3-none-any.whl (15 kB)
Collecting cachetools<5.0,>=2.0.0
  Downloading cachetools-4.0.0-py3-none-any.whl (10 kB)
Collecting setuptools>=40.3.0
  Downloading setuptools-45.2.0-py3-none-any.whl (584 kB)
Building wheels for collected packages: google-api-python-client
  Building wheel for google-api-python-client (setup.py): started
  Building wheel for google-api-python-client (setup.py): finished with status 'done'
  Created wheel for google-api-python-client: filename=google_api_python_client-1.7.11-py3-none-any.whl size=56530 sha256=287400b420bc91aeaaec031fa357d64f3005d2c5b4b27ecdd3e39229675870d2
  Stored in directory: /root/.cache/pip/wheels/69/69/aa/24c58209ab280c154bb17a8ab37294226d776a5cc86aea03b4
Successfully built google-api-python-client
ERROR: awscli 1.18.5 has requirement rsa<=3.5.0,>=3.1.2, but you'll have rsa 4.0 which is incompatible.
Installing collected packages: httplib2, pyasn1, six, rsa, pyasn1-modules, oauth2client, cachetools, setuptools, google-auth, google-auth-httplib2, uritemplate, google-api-python-client
Successfully installed cachetools-4.0.0 google-api-python-client-1.7.11 google-auth-1.11.2 google-auth-httplib2-0.0.3 httplib2-0.17.0 oauth2client-4.1.3 pyasn1-0.4.8 pyasn1-modules-0.2.8 rsa-4.0 setuptools-45.2.0 six-1.14.0 uritemplate-3.0.1

動いた!けどファイル出来上がらない…

マウントの問題かな…

続きはお昼

続き


るな
るな
エンジニア