|
| 1 | +# Docker Images # |
| 2 | + |
| 3 | +The following docker images have been verified to successfully build the source-build repo by: |
| 4 | + |
| 5 | +1. Building source-build |
| 6 | +2. Building the resulting tarball |
| 7 | +3. Running smoke tests |
| 8 | + |
| 9 | +| OS | Image Name | Image Source | Verified Source-build Commit / Date | |
| 10 | +| :--- | :--- | :--- | :---: | |
| 11 | +| CentOS 7.1 | microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416 | [Dockerfile](https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/b46d86339939ada16dfb8be30ebe62fbd51d3999/src/centos/7/Dockerfile) | [4f3eacd](https://github.com/dotnet/source-build/commit/4f3eacdd0551677444ab917d4e332653672e0bd5) / 2018.09.05 | |
| 12 | +| Fedora 28 | microsoft/dotnet-buildtools-prereqs:fedora-28-c103199-20180628122443 | [Dockerfile](https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/c103199065cb74842c2983f0422ea4a1f0b0fe25/src/fedora/28/Dockerfile) | [4f3eacd](https://github.com/dotnet/source-build/commit/4f3eacdd0551677444ab917d4e332653672e0bd5) / 2018.09.05 | |
| 13 | +| Ubuntu 16.04 | microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-c103199-20180628134544 |[Dockerfile](https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/c103199065cb74842c2983f0422ea4a1f0b0fe25/src/ubuntu/16.04/Dockerfile) | [4f3eacd](https://github.com/dotnet/source-build/commit/4f3eacdd0551677444ab917d4e332653672e0bd5) / 2018.09.05 | |
| 14 | + |
| 15 | +## Building source-build with Docker ## |
| 16 | + |
| 17 | +### Running an interactive docker container ### |
| 18 | +``` |
| 19 | +### Run a bash shell inside a docker container. All later steps run in the interactive shell. |
| 20 | +docker run -it --rm <imageName> /bin/bash |
| 21 | +
|
| 22 | +### Clone source-build repo |
| 23 | +git clone https://github.com/dotnet/source-build |
| 24 | +cd source-build |
| 25 | +
|
| 26 | +### Build source-build to create a tarball |
| 27 | +./build-source-tarball.sh ../tarball |
| 28 | +
|
| 29 | +### Build the tarball |
| 30 | +cd ../tarball |
| 31 | +./build.sh |
| 32 | +
|
| 33 | +### Run smoke tests |
| 34 | +./smoke-test.sh |
| 35 | +
|
| 36 | +### Clean up the container when you're done working with the build results |
| 37 | +exit |
| 38 | +``` |
| 39 | + |
| 40 | +### Running with a docker volume ### |
| 41 | +Running build commands in a docker container with a docker volume for a working directory. A docker volume allows you to persist data across docker container instances. |
| 42 | +``` |
| 43 | +### Create a volume on which to build source-build |
| 44 | +docker volume create source-build-volume |
| 45 | +
|
| 46 | +### Clone source-build repo |
| 47 | +docker run --rm --mount source=source-build-volume,target=/src -w /src <imageName> /bin/bash -c "git clone https://github.com/dotnet/source-build" |
| 48 | +
|
| 49 | +### Build source-build to create a tarball |
| 50 | +docker run --rm --mount source=source-build-volume,target=/src -w /src/source-build <imageName> /bin/bash -c "./build-source-tarball.sh ../tarball" |
| 51 | +
|
| 52 | +### Build the tarball |
| 53 | +docker run --rm --mount source=source-build-volume,target=/src -w /src/tarball <imageName> /bin/bash -c "./build.sh" |
| 54 | +
|
| 55 | +### Run smoke tests |
| 56 | +docker run --rm --mount source=source-build-volume,target=/src -w /src/tarball <imageName> /bin/bash -c "./smoke-test.sh" |
| 57 | +
|
| 58 | +### Run an interactive container with the docker volume |
| 59 | +docker run -it --rm --mount source-build-volume,target=/src -w /src <imageName> /bin/bash |
| 60 | +
|
| 61 | +### Remove a volume when finished with it |
| 62 | +docker volume rm source-build-volume |
| 63 | +``` |
0 commit comments