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

Hand_on_Swift_Docker_Bluemix

 Hand_on_Swift_Docker_Bluemix

Swiftコードを使ったWebアプリケーションの新しい開発方法 - Bluemix Swift runtime -
https://bmxug.doorkeeper.jp/events/41438

にて発表した、オープンソースのSwiftとDockerとBluemixを使って、Linux上でSwiftアプリを作成するハンズオン資料です。
オープンソースのSwiftやDockerを触ったことがない方の導入にピッタリです。ぜひご覧ください

Sato Takeshi

March 26, 2016
Tweet

More Decks by Sato Takeshi

Other Decks in Programming

Transcript

  1. ࣮ߦ؀ڥ > OSX El Capitan > Docker version 1.10.3 >

    docker-machine version 0.6.0 12 —
  2. ԼهͷΑ͏ʹϑΝΠϧΛ࡞Δ //main.swift import Foundation import Glibc //To display the words

    to start a 'omikuji' print("Omikuji start!!") for count in 1...3 { print(count) sleep(1) } //To create a seed for the random number from the number of seconds of the current time srandom(UInt32(NSDate().timeIntervalSince1970)) let player = ["Daikichi", "Kichi", "Cyukichi", "Kichi", "Kyou"] print(player[random() % player.count]) 21 —
  3. ݱࡏͷσΟϨΫτϦʔߏ଄ tree -a . . |-- .build | |-- build.db

    | |-- debug | | |-- OmikujiSwift | | |-- OmikujiSwift.build | | | |-- main.d | | | |-- main.swift.o | | | |-- main.swiftdeps | | | |-- main~partial.swiftdoc | | | |-- main~partial.swiftmodule | | | |-- master.swiftdeps | | | `-- output-file-map.json | | |-- OmikujiSwift.swiftdoc | | `-- OmikujiSwift.swiftmodule | `-- debug.yaml |-- Package.swift `-- main.swift 30 —
  4. ࡞੒ΠϝʔδΛ֬ೝ͢Δ docker images REPOSITORY TAG IMAGE ID CREATED SIZE satotakeshi/omikuji_swift

    latest d63340ea7b64 6 seconds ago 897.7 MB swiftdocker/swift latest 6ee180026200 2 weeks ago 870.8 MB 33 —
  5. OSXͷ৔߹͸ҎԼͷ༷ͳίϚϯυͰCFίϚϯ υΛҰൠϢʔβʔ΁มߋ sudo chown <ҰൠϢʔβʔ> /usr/local/bin/cf sudo chown -R <ҰൠϢʔβʔ>

    /usr/local/share/doc/cf-cli sudo chown -R <ҰൠϢʔβʔ> /Users/<ҰൠϢʔβʔ໊>/.cf 42 —
  6. OS XͷϓϥάΠϯΠϯετʔϧίϚϯυ cf install-plugin https://static-ice.ng.bluemix.net/ibm-containers-mac Windows 64 ϏοτͷΠϯετʔϧίϚϯυ cf install-plugin

    https://static-ice.ng.bluemix.net/ibm-containers-windows_x64.exe Windows 32 ϏοτͷΠϯετʔϧίϚϯυ cf install-plugin https://static-ice.ng.bluemix.net/ibm-containers-windows_x86.exe 44 —
  7. IBM CONTAINERS CF CLI ϓϥάΠϯΛ࣮ߦ͠·͢ɻ1 cf ic login 1 ໊લۭؒͷઃఆ͕·ͩͷ৔߹͸ઃఆΛ͠·͢ɻcf

    ic namespace set [YOUR NAMESPACE] ໊લۭؒ͸Ұ౓ઃఆ͢Δͱมߋ͕Ͱ͖·ͤΜɻ 52 —
  8. ࢀߟจݙ > IBM Containers CLI ͷηοτΞοϓ > Πϝʔδͷ؅ཧ > Getting

    Started with Swift on Linux > Docker Hub swiftdocker/swift 60 —