You must install Docker first. It is avilable for Windows, Mac and Linux
Create the image where your Dockerfile
and fibonacci.swift
are located.
docker build -t swift .
Run the swift container and then run your program inside the container
docker run -it swift /bin/bash
or just
docker run -it swift
after you are inside the Docker container you will get a prompt like this:
root@885b0d4180cc:/#
just run
swift fibonacci.swift
the result will be
Fibonacci of 30: 832040