Skip to content

Added preview1/rc2 images for .NET Core and CLI Tools. #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions 0.0.1-alpha/README.md

This file was deleted.

35 changes: 35 additions & 0 deletions 1.0.0-preview1/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions 1.0.0-preview1/README.md
6 changes: 6 additions & 0 deletions 1.0.0-preview1/hooks/post_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -e

echo "Building dependent onbuild image"
docker build --rm --force-rm -t onbuild onbuild/
29 changes: 29 additions & 0 deletions 1.0.0-preview1/hooks/post_push
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions 1.0.0-preview1/onbuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM microsoft/dotnet:1.0.0-preview1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be thinking of onbuild based off of :core instead? With ENTRYPOINT ["dotnet"] users would build in their publish output folder and run their (portable) app with docker run microsoft/dotnet:onbuild myapp.dll it's more lightweight and I'm not sure whether the typical onbuild scenario needs the full sdk.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dleeapho I am not sure I am following? onbuild as defined has to have the full sdk in order to restore and build. Where/when do you see this happening?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I positing that there is another scenario for onbuild, instead of restoring and building in-container that onbuild could also be used to quickly run any portable app. The onbuild would copy the dotnet publish directory contents and myapp.dll would be the args to the dotnet (muxer) entrypoint. In any case we can wait and see if there is a need for what I'm proposing.


RUN mkdir -p /dotnetapp
WORKDIR /dotnetapp

ENTRYPOINT ["dotnet", "run"]

ONBUILD COPY . /dotnetapp
ONBUILD RUN dotnet restore
60 changes: 60 additions & 0 deletions 1.0.0-rc2/README.md
Original file line number Diff line number Diff line change
@@ -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:<version>`

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:<version>-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:<version>-core-deps`

This is an images that contains the prerequisites necessary to run a standalone .NET Core application.

### `microsoft/dotnet:<version>-core`

This is an image that contain the .NET Core runtime and framework that can used to run a .NET Core application.

17 changes: 17 additions & 0 deletions 1.0.0-rc2/core-deps/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/*
6 changes: 6 additions & 0 deletions 1.0.0-rc2/core-deps/hooks/post_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -e

echo "Building dependent care image"
docker build --rm --force-rm -t core ../core/
30 changes: 30 additions & 0 deletions 1.0.0-rc2/core-deps/hooks/post_push
Original file line number Diff line number Diff line change
@@ -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

15 changes: 15 additions & 0 deletions 1.0.0-rc2/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion README.md