Skip to content
This repository was archived by the owner on Feb 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #702 from IBM-Swift/readme
Browse files Browse the repository at this point in the history
docs: Fixes for Docker section of README
  • Loading branch information
Christian Compton authored Jun 19, 2019
2 parents ff9589e + a0edd82 commit 821a06f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions refresh/templates/common/README.scaffold.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,21 @@ To build and run the application:

{{#if docker}}
#### Docker
A description of the files related to Docker can be found in the [Docker files](#docker-files) setion. To build the two docker images, run the following commands from the root directory of the project:
* `docker build -t myapp-run .`
* `docker build -t myapp-build -f Dockerfile-tools .`
A description of the files related to Docker can be found in the [Docker files](#docker-files) section. To build the two Docker images, run the following commands from the root directory of the project.

First, build the 'tools' image. This image contains a full Linux Swift toolchain and is capable of compiling your application for Linux:
* `docker build --tag myapp-build --file Dockerfile-tools .`
You may customize the names of these images by specifying a different value after the `-t` option.

To compile the application using the tools docker image, run:
* `docker run -v $PWD:/swift-project -w /swift-project myapp-build /swift-utils/tools-utils.sh build release`
To compile the application for Linux using the tools Docker image, run:
* `docker run --volume $PWD:/swift-project --workdir /swift-project myapp-build /swift-utils/tools-utils.sh build release`
This produces a `.build-ubuntu` directory which will be incorporated into your final image.

Now that your application has been built, you can build the final run image:
* `docker build --tag myapp-run .`

To run the application:
* `docker run -it -p 8080:8080 -v $PWD:/swift-project -w /swift-project myapp-run sh -c .build-ubuntu/release/{{executableName}}`
Finally, to run the application:
* `docker run -it --publish 8080:8080 myapp-run`


#### Kubernetes
Expand Down

0 comments on commit 821a06f

Please sign in to comment.