Skip to content

Commit

Permalink
Merge pull request dotnet#69 from dotnet/dev
Browse files Browse the repository at this point in the history
Merge dev into master for 1.0.0 release
  • Loading branch information
naamunds authored Jun 23, 2016
2 parents 5b46ea8 + 9fea915 commit 62564aa
Show file tree
Hide file tree
Showing 21 changed files with 338 additions and 30 deletions.
1 change: 0 additions & 1 deletion 1.0.0-preview1/README.md

This file was deleted.

12 changes: 1 addition & 11 deletions 1.0.0-preview1/hooks/post_push
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,9 @@ if [[ $DOCKERCFG == {\"auths\":* ]]; then
fi


echo "Pushing latest image"
echo "Pushing onbuild 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
41 changes: 41 additions & 0 deletions 1.0.0-preview2/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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 apt-get update \
&& apt-get install -y --no-install-recommends \
libc6 \
libcurl3 \
libgcc1 \
libgssapi-krb5-2 \
libicu52 \
liblttng-ust0 \
libssl1.0.0 \
libstdc++6 \
libunwind8 \
libuuid1 \
zlib1g \
&& rm -rf /var/lib/apt/lists/*

# Install .NET Core SDK
ENV DOTNET_SDK_VERSION 1.0.0-preview2-003121
ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_SDK_VERSION/dotnet-dev-debian-x64.$DOTNET_SDK_VERSION.tar.gz

RUN curl -SL $DOTNET_SDK_DOWNLOAD_URL --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

# Trigger the population of the local package cache
ENV NUGET_XMLDOC_MODE skip
RUN mkdir warmup \
&& cd warmup \
&& dotnet new \
&& cd .. \
&& rm -rf warmup
6 changes: 6 additions & 0 deletions 1.0.0-preview2/debian/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-preview2/debian/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-preview2-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-preview2/debian/onbuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM microsoft/dotnet:1.0.0-preview2-sdk

RUN mkdir -p /dotnetapp
WORKDIR /dotnetapp

ENTRYPOINT ["dotnet", "run"]

ONBUILD COPY . /dotnetapp
ONBUILD RUN dotnet restore
29 changes: 29 additions & 0 deletions 1.0.0-preview2/nanoserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM nanoserver

# Install .NET Core SDK
ENV DOTNET_SDK_VERSION 1.0.0-preview2-003121
ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip

RUN powershell -NoProfile -Command \
$ErrorActionPreference = 'Stop'; \
$httpClient = New-Object System.Net.Http.HttpClient; \
$stream = $httpClient.GetAsync('%DOTNET_SDK_DOWNLOAD_URL%').Result.Content.ReadAsStreamAsync().Result; \
$file = [System.IO.File]::Create('dotnet.zip'); \
$stream.CopyTo($file); \
$file.Close(); \
[System.IO.Compression.ZipFile]::ExtractToDirectory('dotnet.zip', '%ProgramFiles%\dotnet'); \
Remove-Item -Force dotnet.zip

RUN setx /M PATH "%PATH%;%ProgramFiles%\dotnet"

# Copy forwarders assemblies to workaround
# https://github.com/dotnet/cli/blob/rel/1.0.0-preview2/Documentation/known-issues.md#running-net-core-cli-on-nano-server
RUN copy "%windir%\System32\forwarders\*" "%ProgramFiles%\dotnet\shared\Microsoft.NETCore.App\1.0.0\"
# Trigger the population of the local package cache
ENV NUGET_XMLDOC_MODE skip
RUN mkdir warmup \
&& cd warmup \
&& dotnet new \
&& cd .. \
&& rmdir /q/s warmup
9 changes: 9 additions & 0 deletions 1.0.0-preview2/nanoserver/onbuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM microsoft/dotnet:1.0.0-preview2-nanoserver-sdk

RUN mkdir dotnetapp
WORKDIR dotnetapp

ENTRYPOINT ["dotnet", "run"]

ONBUILD COPY . .
ONBUILD RUN dotnet restore
21 changes: 21 additions & 0 deletions 1.0.0-preview2/windowsservercore/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM windowsservercore

# Install .NET Core SDK
ENV DOTNET_SDK_VERSION 1.0.0-preview2-003121
ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip

RUN powershell -NoProfile -Command \
$ErrorActionPreference = 'Stop'; \
Invoke-WebRequest %DOTNET_SDK_DOWNLOAD_URL% -OutFile dotnet.zip; \
Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet'; \
Remove-Item -Force dotnet.zip

RUN setx /M PATH "%PATH%;%ProgramFiles%\dotnet"

# Trigger the population of the local package cache
ENV NUGET_XMLDOC_MODE skip
RUN mkdir warmup \
&& cd warmup \
&& dotnet new \
&& cd .. \
&& rmdir /q/s warmup
9 changes: 9 additions & 0 deletions 1.0.0-preview2/windowsservercore/onbuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM microsoft/dotnet:1.0.0-preview2-windowsservercore-sdk

RUN mkdir dotnetapp
WORKDIR dotnetapp

ENTRYPOINT ["dotnet", "run"]

ONBUILD COPY . .
ONBUILD RUN dotnet restore
13 changes: 1 addition & 12 deletions 1.0.0-rc2/core-deps/hooks/post_push
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,9 @@ if [[ $DOCKERCFG == {\"auths\":* ]]; then
fi


echo "Pushing latest core-deps image"
echo "Pushing core 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

14 changes: 9 additions & 5 deletions 1.0.0-rc2/README.md → 1.0.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@ This project is part of .NET Core command-line (CLI) tools. You can find samples
### 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)
- [`1.0.0-preview1` (*1.0.0-preview1/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-preview1/Dockerfile)
- [`1.0.0-preview1-onbuild` (*1.0.0-preview1/onbuild/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-preview1/onbuild/Dockerfile)
- [`1.0.0-preview2-sdk`, `latest` (*1.0.0-preview2/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-preview2/Dockerfile)
- [`1.0.0-preview2-onbuild`, `onbuild` (*1.0.0-preview2/onbuild/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-preview2/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)
- [`1.0.0-rc2-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` (*1.0.0-rc2/core/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0-rc2/core/Dockerfile)
- [`1.0.0-core-deps`, `core-deps` (*1.0.0/core-deps/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0/core-deps/Dockerfile)
- [`1.0.0-core`, `core` (*1.0.0/core/Dockerfile*)](https://github.com/dotnet/dotnet-docker/blob/master/1.0.0/core/Dockerfile)

## Image variants

The `microsoft/dotnet` image come in different flavors, each designed for a specific use case.

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

This image contains the .NET Core SDK which is comprised of two parts:

Expand Down
17 changes: 17 additions & 0 deletions 1.0.0/debian/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 \
libgssapi-krb5-2 \
libicu52 \
liblttng-ust0 \
libssl1.0.0 \
libstdc++6 \
libunwind8 \
libuuid1 \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
6 changes: 6 additions & 0 deletions 1.0.0/debian/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/debian/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-core"
docker tag core $versionedImageName
docker push $versionedImageName

latestImageName=$repoName":core"
docker tag core $latestImageName
docker push $latestImageName

17 changes: 17 additions & 0 deletions 1.0.0/debian/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM microsoft/dotnet:1.0.0-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_VERSION 1.0.0
ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_VERSION/dotnet-debian-x64.$DOTNET_VERSION.tar.gz

RUN curl -SL $DOTNET_DOWNLOAD_URL --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
21 changes: 21 additions & 0 deletions 1.0.0/nanoserver/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM nanoserver

# Install .NET Core
ENV DOTNET_VERSION 1.0.0
ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_VERSION/dotnet-win-x64.$DOTNET_VERSION.zip

RUN powershell -NoProfile -Command \
$ErrorActionPreference = 'Stop'; \
$httpClient = New-Object System.Net.Http.HttpClient; \
$stream = $httpClient.GetAsync('%DOTNET_DOWNLOAD_URL%').Result.Content.ReadAsStreamAsync().Result; \
$file = [System.IO.File]::Create('dotnet.zip'); \
$stream.CopyTo($file); \
$file.Close(); \
[System.IO.Compression.ZipFile]::ExtractToDirectory('dotnet.zip', '%ProgramFiles%\dotnet'); \
Remove-Item -Force dotnet.zip

RUN setx /M PATH "%PATH%;%ProgramFiles%\dotnet"

# Copy forwarders assemblies to workaround
# https://github.com/dotnet/cli/blob/rel/1.0.0-preview2/Documentation/known-issues.md#running-net-core-cli-on-nano-server
RUN copy "%windir%\System32\forwarders\*" "%ProgramFiles%\dotnet\shared\Microsoft.NETCore.App\1.0.0\"
13 changes: 13 additions & 0 deletions 1.0.0/windowsservercore/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM windowsservercore

# Install .NET Core
ENV DOTNET_VERSION 1.0.0
ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_VERSION/dotnet-win-x64.$DOTNET_VERSION.zip

RUN powershell -NoProfile -Command \
$ErrorActionPreference = 'Stop'; \
Invoke-WebRequest %DOTNET_DOWNLOAD_URL% -OutFile dotnet.zip; \
Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet'; \
Remove-Item -Force dotnet.zip

RUN setx /M PATH "%PATH%;%ProgramFiles%\dotnet"
2 changes: 1 addition & 1 deletion README.md
45 changes: 45 additions & 0 deletions scripts/BuildWindowsImages.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
REM Interim script to assist in building Windows images until Docker Hub auto builds support Windows

Set DOTNET_SDK_VERSION=1.0.0-preview2
Set DOTNET_VERSION=1.0.0

IF NOT DEFINED REPO_OWNER (
set REPO_OWNER=microsoft
)

IF DEFINED NANO_SERVER (
pushd %DOTNET_SDK_VERSION%\nanoserver
docker build -t %REPO_OWNER%/dotnet:nanoserver . || goto :error
docker tag %REPO_OWNER%/dotnet:nanoserver %REPO_OWNER%/dotnet:%DOTNET_SDK_VERSION%-nanoserver-sdk || goto :error
popd

pushd %DOTNET_SDK_VERSION%\nanoserver\onbuild
docker build -t %REPO_OWNER%/dotnet:nanoserver-onbuild . || goto :error
docker tag %REPO_OWNER%/dotnet:nanoserver-onbuild %REPO_OWNER%/dotnet:%DOTNET_SDK_VERSION%-nanoserver-onbuild || goto :error
popd

pushd %DOTNET_VERSION%\nanoserver\core
docker build -t %REPO_OWNER%/dotnet:nanoserver-core . || goto :error
docker tag %REPO_OWNER%/dotnet:nanoserver-core %REPO_OWNER%/dotnet:%DOTNET_VERSION%-nanoserver-core || goto :error
popd
) ELSE (
pushd %DOTNET_SDK_VERSION%\windowsservercore
docker build -t %REPO_OWNER%/dotnet:windowsservercore . || goto :error
docker tag %REPO_OWNER%/dotnet:windowsservercore %REPO_OWNER%/dotnet:%DOTNET_SDK_VERSION%-windowsservercore-sdk || goto :error
popd

pushd %DOTNET_SDK_VERSION%\windowsservercore\onbuild
docker build -t %REPO_OWNER%/dotnet:windowsservercore-onbuild . || goto :error
docker tag %REPO_OWNER%/dotnet:windowsservercore-onbuild %REPO_OWNER%/dotnet:%DOTNET_SDK_VERSION%-windowsservercore-onbuild || goto :error
popd

pushd %DOTNET_VERSION%\windowsservercore\core
docker build -t %REPO_OWNER%/dotnet:windowsservercore-core . || goto :error
docker tag %REPO_OWNER%/dotnet:windowsservercore-core %REPO_OWNER%/dotnet:%DOTNET_VERSION%-windowsservercore-core || goto :error
popd

goto :EOF

:error
popd
exit /B 1
Loading

0 comments on commit 62564aa

Please sign in to comment.