Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker Private Registryのデプロイと運用

Docker Private Registryのデプロイと運用

第2回 MasterCloud (https://mastercloud.connpass.com/event/57936/) の発表スライドです。

Yukihiko SAWANOBORI

June 14, 2017
Tweet

More Decks by Yukihiko SAWANOBORI

Other Decks in Technology

Transcript

  1.  %PDLFSIVC%PDLFS$MPVE ˞σϑΥϧτ   2VBZJP  'SPH"SUJGBDUPSZ #JOUSBZ 

     "84"[VSF($1ͦΕͧΕʹ΋ઐ༻αʔϏε  3FE)BUͷ0QFO4IJGUܥ͍Ζ͍Ζ طଘͷαʔϏε΋ଟ਺ଘࡏ
  2. ετϨʔδαϙʔτҰཡ ˞࣌఺ FileSystem / inmemory ϩʔΧϧʹอଘɻεέʔϧ͠·ͤΜɻ Azure Blob Storage Ϋϥ΢υαʔϏεͷ

    ΦϒδΣΫτετϨʔδ ௨ৗ͸͜ΕΒͷ͍ͣΕ͔Λɻ Google Cloud Storage Amazon S3 Aliyun Object Storage Service OpenStack Swift 4XJGUʹอଘɻεέʔϧ͸Մɻ
  3.  $POpHVSJOHBSFHJTUSZ %PD  IUUQTEPDTEPDLFSDPNSFHJTUSZDPOpHVSBUJPO   ઃఆϑΝΠϧͷΩʔͱ؀ڥม਺ ༏ઌ ͕ରԠ

     ZBNMͱϓϨϑΟΫεA3&(*453:@AͰಉҰ߲໨ %PDLFS3FHJTUSZͷઃఆ storage: filesystem: rootdirectory: /path/to/dir REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/path/to/dir ͜ΕΒ͕ಉ͡໾ׂ ˞Ұ෦ྫ֎ΞϦ
  4.  Ͱ͖ͳ͍ྫ  "SSBZ໊લඃΓ  :".-ͰͷΈઃఆՄೳ  ରࡦ͸ݕ౼தʁ  IUUQTHJUIVCDPNEPDLFSEJTUSJCVUJPOJTTVFT

    ؀ڥม਺ͷྫ֎ʹ͍ͭͯ notifications: endpoints: - name: foo url: http://foo.example.net/events - name: bar url: http://bar.example.net/events
  5.  %PDLFS͸ZVNͰ0,    0CKFDU4UPSBHFར༻ͷ
 DPOpHZNMهड़ྫ ΠϯελϯεηοτΞοϓ  $

    sudo yum-config-manager —add-repo \ https://download.docker.com/linux/centos/docker-ce.repo $ sudo install docker-ce version: 0.1 http: secret: M@STERCLOUD addr: 0.0.0.0:5000 storage: oss: accesskeyid: {YOUR_ACCESS_KEY} accesskeysecret: {YOUR_ACCESS_KEY_SECRET} region: oss-ap-northeast-1 bucket: {YORU_BUCKET_NAME} internal: true secure: false chunksize: 52428800 delete: enabled: true
  6.  DPOpHZNMΛ༻ҙͨ͠Β  EPDLFS୯ମͰࣗಈىಈઃఆΛ͓͖ͯ͠·͢ɻ ΠϯελϯεηοτΞοϓ  $ sudo systemctl start

    docker $ sudo systemctl enable docker $ docker run -p 5000:5000 --name registry \ --restart always -d \ -v `pwd`/config.yml:/etc/docker/registry/config.yml \ registry:2
  7.  ୯ମͳΒ͹͜ͷ࣌఺ͰՔಇ͠·͢ ΠϯελϯεηοτΞοϓ  $ curl 127.0.0.1:5000/v2/ {} $ docker

    pull alpine:latest latest: Pulling from library/alpine Status: Image is up to date for alpine:latest $ docker tag alpine:latest localhost:5000/alpine:latest $ docker push localhost:5000/alpine:latest The push refers to a repository [localhost:5000/alpine] 3fb66f713c9f: Pushed JNBHFQVTI0,
  8.  "MJCBCBಛ༗ͷઃఆ ίπ   TUPSBHF@PTT@JOUFSOBMUSVF  044ͷ಺෦ΤϯυϙΠϯτΛར༻  ͜ΕΛ͠ͳ͍ͱɺΩϟοϓ͕͔͔Γͱͯ΋஗͍ʂ

     TUPSBHF@PTT@TFDVSFGBMTF  ಺෦ΤϯυϙΠϯτ͸)551  TUPSBHF@PTT@DIVOLTJ[F .# ˞ࢀߟ  ෼ׂΞοϓϩʔυ൑ఆ͢ΔαΠζɺJOUFSOBMͳΒେ͖Ίʹɻ ׬ྃ࣌ؒʹӨڹ ઃఆิ଍ 
  9.  ϩʔΧϧͰ΋Α͍ͷͰɺೝূΛ  /4Ͱ"ϨίʔυΛద༻  4-#ʹ͸$/".&༻ͷσϑΥϧτϨίʔυͳ͠   αʔόূ໌ॻΛ4-#ʹઃఆ 

    "84ͷ$FSUJpDBUF.BOBHFS૬౰͕ఏڙ͞ΕΔͱخ͍͠Ͱ͢Ͷʜ   6QHSBEF࣌͸΋͏Ұ౓ΧελϜΠϝʔδΛ࡞੒ೖସ ͪΌΜͱ࢖͏ͳΒɺ΋͏Ұखؒ