Docker image for building and running the Swift Sample Starter App inside an IBM Container on Bluemix.
You can execute the following command to download the latest version of this image from Docker Hub:
docker pull ibmcom/swift-helloworld-ubuntu:latest
- install Docker on your operating system
- run the Docker Daemon from your terminal
dockerd
3. enter the directory containing the application you want to run in Docker
3. Build the Docker image:
docker build -t swift-helloworld-docker .
4. Run the web server:
docker run -p 8090:8090 -d <your_docker_image_name>
- Login to your Bluemix account (create an account, if necessary)
- Download and install the Cloud Foundry tools
- Login to Bluemix CLI:
cf loginfollow the instructions and fill your email, username, organization and space. if you get an error, try to remove the .cf directory and then to run the cf cli again:sudo rm -r ~/.cfcf -h - Download and install the IBM Container's Plugin
- Configure the IBM Container's Plugin - set your IBM Container Namespace.
- Login into cf ic:
cd ic login - Tag the Docker image:
docker tag <your_docker_image_name> registry.ng.bluemix.net/<namespace from step 5>/<your_docker_image_name> - Push the Docker image:
docker push registry.ng.bluemix.net/<namespace from step 5>/<your_docker_image_name>ordocker push registry.eu-gb.bluemix.net/<namespace from step 5>/<your_docker_image_name> - Go to Bluemix and click
Containerson the drop down menu on the left. clickCreate Containers
- Select the Docker image that was pushed in Step 8

- Configure the Container:
Make sure to switch from Single to Scalable Group, name your group and to set HTTP port to 8090 (the your app listens to)


- The URL of the app appears in the "Routes" field of the Container Overview
- Now you can test and access your app by the URL from step 12. In particular, when accessing the app's URL, a "Hello from Swift on Linux!" message will be returned, along with the Environment Variables and objects". Note that you must not to append the port to the URL, the default ports will be used. (The port 8090 that you specified in step 13 is used by Bluemix to access your app and is mapped to the default HTTP/HTTPS ports)