diff --git a/0.0.1-alpha/README.md b/0.0.1-alpha/README.md deleted file mode 100644 index fa066a1178..0000000000 --- a/0.0.1-alpha/README.md +++ /dev/null @@ -1,61 +0,0 @@ -.NET CLI Preview Docker Image -==================== - -This repository contains `Dockerfile` definitions for [dotnet/cli] Docker images. - -This project is part of .NET Core command-line (CLI) tools. You can find samples, documentation, and getting started instructions for .NET Core CLI tools at the [dotnet/cli] repo. - -# Supported tags and respective `Dockerfile` links - -- [`0.0.1-alpha`, latest (*0.0.1-alpha/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/0.0.1-alpha/Dockerfile) -- [`0.0.1-alpha-onbuild`, `latest-onbuild` (*0.0.1-alpha/onbuild/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/0.0.1-alpha/onbuild/Dockerfile) - -# How to use this image - -## Start an instance of your app - -The most straightforward way to use this image is to use a .NET container as both the build and runtime environment. In your `Dockerfile`, writing something along the lines of the following will compile and run your project: - -```dockerfile -FROM microsoft/dotnet:0.0.1-alpha-onbuild -``` - -This image includes multiple `ONBUILD` triggers which should cover most applications. The build will `COPY . /dotnetapp` and `RUN dotnet restore`. - -This image also includes the `ENTRYPOINT dotnet run` instruction which will run your application when the Docker image is run. - -You can then build and run the Docker image: - -```console -$ docker build -t my-dotnet-app . -$ docker run -it --rm --name my-running-app my-dotnet-app -``` - -## Compile your app inside the Docker container - -There may be occasions where it is not appropriate to run your app inside a container. To compile, but not run your app inside the Docker instance, you can write something like: - -```console -$ docker run --rm -v "$PWD":/myapp -w /myapp microsoft/dotnet:0.0.1-alpha dotnet compile -``` - -This will add your current directory as a volume to the container, set the working directory to the volume, and run the command `dotnet compile` which will tell dotnet to compile the project in the working directory. - -# Image variants - -The `microsoft/dotnet` image come in many flavors, each designed for a specific use case. - -## `microsoft/dotnet:` - -This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. This tag is based off of [`buildpack-deps`](https://registry.hub.docker.com/_/buildpack-deps/). `buildpack-deps` is designed for the average user of docker who has many images on their system. It, by design, has a large number of extremely common Debian packages. This reduces the number of packages that images that derive from it need to install, thus reducing the overall size of all images on your system. - -## `microsoft/dotnet:-onbuild` - -This image makes building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM microsoft/dotnet:onbuild` will be enough to create a stand-alone image for your project. - -While the `onbuild` variant is really useful for "getting off the ground running" (zero to Dockerized in a short period of time), it's not recommended for long-term usage within a project due to the lack of control over *when* the `ONBUILD` triggers fire (see also [`docker/docker#5714`](https://github.com/docker/docker/issues/5714), [`docker/docker#8240`](https://github.com/docker/docker/issues/8240), [`docker/docker#11917`](https://github.com/docker/docker/issues/11917)). - -Once you've got a handle on how your project functions within Docker, you'll probably want to adjust your `Dockerfile` to inherit from a non-`onbuild` variant and copy the commands from the `onbuild` variant `Dockerfile` (moving the `ONBUILD` lines to the end and removing the `ONBUILD` keywords) into your own file so that you have tighter control over them and more transparency for yourself and others looking at your `Dockerfile` as to what it does. This also makes it easier to add additional requirements as time goes on (such as installing more packages before performing the previously-`ONBUILD` steps). - -[dotnet/cli]: https://github.com/dotnet/cli - diff --git a/1.0.0-preview1/Dockerfile b/1.0.0-preview1/Dockerfile new file mode 100644 index 0000000000..33fc213127 --- /dev/null +++ b/1.0.0-preview1/Dockerfile @@ -0,0 +1,35 @@ +FROM buildpack-deps:jessie-scm + +# Work around https://github.com/dotnet/cli/issues/1582 until Docker releases a +# fix (https://github.com/docker/docker/issues/20818). This workaround allows +# the container to be run with the default seccomp Docker settings by avoiding +# the restart_syscall made by LTTng which causes a failed assertion. +ENV LTTNG_UST_REGISTER_TIMEOUT 0 + +# Install .NET CLI dependencies +RUN echo "deb [arch=amd64] http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.6 main" > /etc/apt/sources.list.d/llvm.list \ + && wget -q -O - http://llvm.org/apt/llvm-snapshot.gpg.key|apt-key add - \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + clang-3.5 \ + libc6 \ + libcurl3 \ + libgcc1 \ + libicu52 \ + liblldb-3.6 \ + liblttng-ust0 \ + libssl1.0.0 \ + libstdc++6 \ + libtinfo5 \ + libunwind8 \ + libuuid1 \ + zlib1g \ + && rm -rf /var/lib/apt/lists/* + +# Install .NET Core SDK +ENV DOTNET_CORE_SDK_VERSION 1.0.0-preview1-002702 +RUN curl -SL https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/$DOTNET_CORE_SDK_VERSION/dotnet-dev-debian-x64.$DOTNET_CORE_SDK_VERSION.tar.gz --output dotnet.tar.gz \ + && mkdir -p /usr/share/dotnet \ + && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ + && rm dotnet.tar.gz \ + && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet diff --git a/1.0.0-preview1/README.md b/1.0.0-preview1/README.md new file mode 120000 index 0000000000..21b70e3547 --- /dev/null +++ b/1.0.0-preview1/README.md @@ -0,0 +1 @@ +../1.0.0-rc2/README.md \ No newline at end of file diff --git a/1.0.0-preview1/hooks/post_build b/1.0.0-preview1/hooks/post_build new file mode 100644 index 0000000000..e85ae87081 --- /dev/null +++ b/1.0.0-preview1/hooks/post_build @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e + +echo "Building dependent onbuild image" +docker build --rm --force-rm -t onbuild onbuild/ diff --git a/1.0.0-preview1/hooks/post_push b/1.0.0-preview1/hooks/post_push new file mode 100755 index 0000000000..7c5eb6a873 --- /dev/null +++ b/1.0.0-preview1/hooks/post_push @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e + +# Issue - https://github.com/docker/hub-feedback/issues/384#issuecomment-214508878 +# Docker Hub emits an invalid .dockercfg. Remove the outer auths element. +if [[ $DOCKERCFG == {\"auths\":* ]]; then + jsonStartIndex=$(expr index "$DOCKERCFG" :) + length=$((${#DOCKERCFG} - $jsonStartIndex - 1)) + echo ${DOCKERCFG:jsonStartIndex:length} > /root/.dockercfg +fi + + +echo "Pushing latest image" +tagStartIndex=$(expr index "$IMAGE_NAME" :) +repoName=${IMAGE_NAME:0:tagStartIndex - 1} +latestImageName=$repoName":latest" +docker tag $IMAGE_NAME $latestImageName +docker push $latestImageName + + +echo "Pushing onbuild images" +versionedImageName=$repoName":1.0.0-preview1-onbuild" +docker tag onbuild $versionedImageName +docker push $versionedImageName + +latestImageName=$repoName":onbuild" +docker tag onbuild $latestImageName +docker push $latestImageName diff --git a/1.0.0-preview1/onbuild/Dockerfile b/1.0.0-preview1/onbuild/Dockerfile new file mode 100644 index 0000000000..45ccbe159d --- /dev/null +++ b/1.0.0-preview1/onbuild/Dockerfile @@ -0,0 +1,9 @@ +FROM microsoft/dotnet:1.0.0-preview1 + +RUN mkdir -p /dotnetapp +WORKDIR /dotnetapp + +ENTRYPOINT ["dotnet", "run"] + +ONBUILD COPY . /dotnetapp +ONBUILD RUN dotnet restore diff --git a/1.0.0-rc2/README.md b/1.0.0-rc2/README.md new file mode 100644 index 0000000000..d13071768d --- /dev/null +++ b/1.0.0-rc2/README.md @@ -0,0 +1,60 @@ +![](https://avatars0.githubusercontent.com/u/9141961?v=3&s=100) + +.NET Core Docker Image +==================== + +This repository contains `Dockerfile` definitions for [dotnet/cli](https://github.com/dotnet/cli) Docker images. + +This project is part of .NET Core command-line (CLI) tools. You can find samples, documentation, and getting started instructions for .NET Core CLI tools on our [getting started](http://dotnet.github.io/getting-started/) page. + +[![Downloads from Docker Hub](https://img.shields.io/docker/pulls/microsoft/dotnet.svg)](https://registry.hub.docker.com/u/microsoft/dotnet) +[![Stars on Docker Hub](https://img.shields.io/docker/stars/microsoft/dotnet.svg)](https://registry.hub.docker.com/u/microsoft/dotnet) + + +## Supported tags + +### Development images +- [`0.0.1-alpha`, (*0.0.1-alpha/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/0.0.1-alpha/Dockerfile) +- [`0.0.1-alpha-onbuild`, (*0.0.1-alpha/onbuild/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/0.0.1-alpha/onbuild/Dockerfile) +- [`1.0.0-preview1`, `latest` (*1.0.0-preview1/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-preview1/Dockerfile) +- [`1.0.0-preview1-onbuild`, `onbuild` (*1.0.0-preview1/onbuild/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-preview1/onbuild/Dockerfile) + +### Runtime images +- [`1.0.0-rc2-core-deps`, `core-deps` (*1.0.0-rc2/core-deps/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-rc2/core-deps/Dockerfile) +- [`1.0.0-rc2-core`, `core` (*1.0.0-rc2/core/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-rc2/core/Dockerfile) + +## Image variants + +The `microsoft/dotnet` image come in different flavors, each designed for a specific use case. + +### `microsoft/dotnet:` + +This is the defacto image. It contains the .NET Core runtime and framework as well as CLI tools. This image can be used to develop .NET Core applications as well as a place to run, test, and debug them. + +### `microsoft/dotnet:-onbuild` + +The most straightforward way to use this image is to use a .NET container as both the build and runtime environment. In your `Dockerfile`, writing something along the lines of the following will compile and run your project: + +```dockerfile +FROM microsoft/dotnet:onbuild +``` + +This image includes multiple `ONBUILD` triggers which should cover most applications. The build will `COPY . /dotnetapp` and `RUN dotnet restore`. + +This image also includes the `ENTRYPOINT dotnet run` instruction which will run your application when the Docker image is run. + +You can then build and run the Docker image: + +```console +$ docker build -t my-dotnet-app . +$ docker run -it --rm --name my-running-app my-dotnet-app +``` + +### `microsoft/dotnet:-core-deps` + +This is an images that contains the prerequisites necessary to run a standalone .NET Core application. + +### `microsoft/dotnet:-core` + +This is an image that contain the .NET Core runtime and framework that can used to run a .NET Core application. + diff --git a/1.0.0-rc2/core-deps/Dockerfile b/1.0.0-rc2/core-deps/Dockerfile new file mode 100644 index 0000000000..c2a4ea144a --- /dev/null +++ b/1.0.0-rc2/core-deps/Dockerfile @@ -0,0 +1,17 @@ +FROM debian:jessie + +# Install .NET Core dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + libc6 \ + libcurl3 \ + libgcc1 \ + libicu52 \ + liblttng-ust0 \ + libssl1.0.0 \ + libstdc++6 \ + libtinfo5 \ + libunwind8 \ + libuuid1 \ + zlib1g \ + && rm -rf /var/lib/apt/lists/* diff --git a/1.0.0-rc2/core-deps/hooks/post_build b/1.0.0-rc2/core-deps/hooks/post_build new file mode 100644 index 0000000000..a1e47e544b --- /dev/null +++ b/1.0.0-rc2/core-deps/hooks/post_build @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e + +echo "Building dependent care image" +docker build --rm --force-rm -t core ../core/ diff --git a/1.0.0-rc2/core-deps/hooks/post_push b/1.0.0-rc2/core-deps/hooks/post_push new file mode 100644 index 0000000000..bcb30fecad --- /dev/null +++ b/1.0.0-rc2/core-deps/hooks/post_push @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e + +# Issue - https://github.com/docker/hub-feedback/issues/384#issuecomment-214508878 +# Docker Hub emits an invalid .dockercfg. Remove the outer auths element. +if [[ $DOCKERCFG == {\"auths\":* ]]; then + jsonStartIndex=$(expr index "$DOCKERCFG" :) + length=$((${#DOCKERCFG} - $jsonStartIndex - 1)) + echo ${DOCKERCFG:jsonStartIndex:length} > /root/.dockercfg +fi + + +echo "Pushing latest core-deps image" +tagStartIndex=$(expr index "$IMAGE_NAME" :) +repoName=${IMAGE_NAME:0:tagStartIndex - 1} +latestImageName=$repoName":core-deps" +docker tag $IMAGE_NAME $latestImageName +docker push $latestImageName + + +echo "Pushing core images" +versionedImageName=$repoName":1.0.0-rc2-core" +docker tag core $versionedImageName +docker push $versionedImageName + +latestImageName=$repoName":core" +docker tag core $latestImageName +docker push $latestImageName + diff --git a/1.0.0-rc2/core/Dockerfile b/1.0.0-rc2/core/Dockerfile new file mode 100644 index 0000000000..25ac95771b --- /dev/null +++ b/1.0.0-rc2/core/Dockerfile @@ -0,0 +1,15 @@ +FROM microsoft/dotnet:1.0.0-rc2-core-deps + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + && rm -rf /var/lib/apt/lists/* + +# Install .NET Core +ENV DOTNET_CORE_VERSION 1.0.0-rc2-3002702 +RUN curl -SL https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/$DOTNET_CORE_VERSION/dotnet-debian-x64.$DOTNET_CORE_VERSION.tar.gz --output dotnet.tar.gz \ + && mkdir -p /usr/share/dotnet \ + && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ + && rm dotnet.tar.gz \ + && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet diff --git a/README.md b/README.md index 4e1f556b0a..0b240e3817 120000 --- a/README.md +++ b/README.md @@ -1 +1 @@ -0.0.1-alpha/README.md \ No newline at end of file +1.0.0-rc2/README.md \ No newline at end of file