Skip to content

Commit

Permalink
[docker] refs #27 Add .NET Core to Dockerfile
Browse files Browse the repository at this point in the history
- Add VS_EXTENSIONS as build-arg
- Add step to install VS_EXTENSIONS on image build
- Mod hooks to build and push more than develop image
  • Loading branch information
stdevYuniers committed Dec 14, 2018
1 parent ad8aa23 commit 612ac3e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
8 changes: 7 additions & 1 deletion docker/images/dev-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM $IMAGE_FROM

ARG BDATE
ARG SCOMMIT
ARG VS_EXTENSIONS

# Image labels (see ./hooks/build for ARGS)
LABEL "org.label-schema.name"="libskycoin-dotnet" \
Expand All @@ -17,16 +18,19 @@ LABEL "org.label-schema.name"="libskycoin-dotnet" \
"org.label-schema.usage"="https://github.com/skycoin/libskycoin-dotnet/blob/"$SCOMMIT"/docker/images/dev-cli/README.md" \
"org.label-schema.docker.cmd"="mkdir src; docker run --rm -v ${PWD}/src:/usr/local/src skycoin/skycoindev-dotnet:develop git clone https://github.com/simelo/libskycoin-dotnet.git; sudo chown -R `whoami` src"

# Define some important environment variables
ENV MONO_VERSION 4.8.0.524
ENV DEBIAN_FRONTEND noninteractive

# Add mono debian repo and ins
# Add mono and repo and install necessary packages
RUN apt update \
&& apt upgrade -y \
&& apt install -y curl \
apt-transport-https \
dirmngr \
&& curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | apt-key add - \
&& apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb [arch=amd64] https://packages.microsoft.com/debian/9/prod stretch main" > /etc/apt/sources.list.d/microsoft-dotnet.list \
&& echo "deb https://download.mono-project.com/repo/debian wheezy/snapshots/$MONO_VERSION main" > /etc/apt/sources.list.d/mono-official-stable.list \
&& apt update \
&& apt install -y \
Expand All @@ -37,6 +41,8 @@ RUN apt update \
mono-vbnc \
nuget \
referenceassemblies-pcl \
dotnet-sdk-2.2 \
&& for ext in $VS_EXTENSIONS; do code --user-data-dir $HOME --install-extension $ext; done \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/*

Expand Down
10 changes: 6 additions & 4 deletions docker/images/dev-cli/hooks/build
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,24 @@ docker build --build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \

# Build :dind, :vscode and :vscode-dind tag
# Only build if
if [ "$CACHE_TAG" -eq "develop" ]; then
# if [ "$CACHE_TAG" -eq "develop" ]; then
docker build --build-arg IMAGE_FROM="skycoin/skycoindev-cli:dind" \
--build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
-f $DOCKERFILE_PATH \
-t "$DOCKER_REPO:dind" .

docker build --build-arg IMAGE_FROM="skycoin/skycoindev-vscode:develop" \
docker build --build-arg IMAGE_FROM="simelotech/skycoindev-vscode:develop" \
--build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
--build-arg VS_EXTENSIONS="ms-vscode.csharp Leopotam.csharpfixformat jchannon.csharpextensions"
-f $DOCKERFILE_PATH \
-t "$DOCKER_REPO:vscode" .

docker build --build-arg IMAGE_FROM="skycoin/skycoindev-vscode:dind" \
docker build --build-arg IMAGE_FROM="simelotech/skycoindev-vscode:dind" \
--build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg SCOMMIT=$SOURCE_COMMIT \
--build-arg VS_EXTENSIONS="ms-vscode.csharp Leopotam.csharpfixformat jchannon.csharpextensions"
-f $DOCKERFILE_PATH \
-t "$DOCKER_REPO:vscode-dind" .
fi
# fi
4 changes: 2 additions & 2 deletions docker/images/dev-cli/hooks/push
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

docker push $IMAGE_NAME

if [ "$CACHE_TAG" -eq "develop" ]; then
# if [ "$CACHE_TAG" -eq "develop" ]; then
docker push $DOCKER_REPO:dind
docker push $DOCKER_REPO:vscode
docker push $DOCKER_REPO:vscode-dind
fi
# fi

0 comments on commit 612ac3e

Please sign in to comment.