Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Swift in Docker
Search
Johnlin
February 07, 2017
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swift in Docker
Johnlin
February 07, 2017
More Decks by Johnlin
See All by Johnlin
用 MLIR 實作 一個 Ruby IR (intermediate representation)
johnlinvc
0
420
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
510
Ruby 型別檢查工具簡介
johnlinvc
0
720
Swift Actor 實作探索
johnlinvc
0
250
用 mruby 來寫跨平台工具
johnlinvc
0
170
Actor model 簡介
johnlinvc
0
310
一起玩 Helm 3
johnlinvc
1
220
為什麼 App 卡卡的
johnlinvc
2
1.4k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
310
Other Decks in Programming
See All in Programming
Distance field of Julia set
kinakomoti321
0
270
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
340
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
410
小さなアプリを作って公開するまで
onozaty
0
130
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.2k
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
160
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
170
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
530
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
330
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
120
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
220
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
230
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
174
15k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.3k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
810
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Making Projects Easy
brettharned
120
6.8k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
How to make the Groovebox
asonas
2
2.5k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Mobile First: as difficult as doing things right
swwweet
225
10k
How to build a perfect <img>
jonoalderson
1
6.2k
Transcript
Swift in Docker John Lin (@johnlinvc)
ॄኄੋDocker? • 㟬తఔࣜแҰݸ༰ث(container)ɼཁ༗ Docker తํबՄҎ䋯ɻ • ༰ثཫ໘ෆ༗ఔࣜɼՄҎ์ఔࣜӡߦॴधత૬᮫ ࢿྉɼവࣜݿɼܥ౷݅ɻ • ༻ိ։ᚙɼᚙఔࣜɼํศɻ
Docker VM ༗ॄኄෆҰᒬʁ • Docker ڞ༻࡞ۀܥ౷ɻ • Docker ൺֱলࢿݯɻ
҆ Docker • લࢧԉ Mac, Windows, Linux • https://www.docker.com/products/docker#/mac
Մ ҎԼࡌ҆䈕ɻ
Docker ө૾䈕(image) • ༰ثతجૅɼ㑌Ұݸ༰ثඞਢ༗Ұݸө૾䈕ɼө૾ 䈕ཫ༗༰ث㚎֘༗త䈕Ҋɻ • ө૾䈕 => UILabel (Class),
༰ث => myLabel (instance) • ՄҎଟݸ༰ثڞ༻Ұݸө૾䈕ɻ
docker run • docker run <ө૾䈕໊> <ཁࣥߦతఔࣜ> • ။༻ө૾䈕త㚎༰㗞ੜҰݸ༰ثɼฒࡏ༰ث㚎ࣥߦ ఔࣜ
Swift in Docker • https://github.com/swiftdocker/docker-swift • docker run --cap-add sys_ptrace
-it --rm swift swift ՄҎࣥߦ REPL • Swift REPL Ҽҝ༻౸ ptraceɼॴҎधཁֹ֎తᒟݶ
Live demo
ݐஔ&ᚙ Package • ՄҎ༻ docker ိݐஔ݅ • ࠶ฤᩄత݅์ࡏ docker ཫ໘ᚙɻ
ݐஔ Package • docker run -v `pwd`/:/docker-swift -w /docker- swift
--rm swift swift package init 㗞ੜ Package ૬᮫䈕Ҋ • echo 'print("hello docker")' >> Sources/ main.swift ࡏࣥߦ䈕࠷ޙՃ্Ұݸprint hello docker
ݐஔ Package • docker run -v `pwd`/:/docker-swift -w /docker- swift
--rm swift swift build ݐஔ Package • docker run -v `pwd`/:/docker-swift -w /docker- swift --rm swift .build/debug/docker-swift ࣥߦhello docker
Live demo
Kitura • IBM ݚᚙత Swift web framework • Opensource •
ՄҎ༻ Docker Swift ိ䋯
Update docker file FROM ibmcom/swift-ubuntu:latest EXPOSE 8080 RUN mkdir /root/Kitura-Starter
ADD Sources /root/Kitura-Starter ADD Package.swift /root/Kitura-Starter ADD LICENSE /root/Kitura-Starter ADD .swift-version /root/Kitura-Starter RUN cd /root/Kitura-Starter && swift build USER root CMD [ "sh", "-c", "cd /root/Kitura-Starter && .build/debug/Kitura-Starter" ]
Update docker file FROM swift:3.0.2 EXPOSE 8080 RUN mkdir /root/Kitura-Starter
ADD Sources /root/Kitura-Starter ADD Package.swift /root/Kitura-Starter ADD LICENSE /root/Kitura-Starter ADD .swift-version /root/Kitura-Starter RUN apt update RUN apt-get install -y libssl-dev WORKDIR /root/Kitura-Starter RUN swift package update RUN swift build USER root CMD [ "sh", "-c", "cd /root/Kitura-Starter && .build/debug/Kitura-Starter" ]
Live demo
݁ • ՄҎ༻ docker ိ։ᚙ Linux త Swift ఔࣜ •
ՄҎ༻ docker ိࣥߦ Swift
Q&A