Skip to content

Commit

Permalink
Update docker on gitlab build manifests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanelian committed Nov 20, 2020
1 parent 78d059d commit 6c820d6
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -725,19 +725,21 @@ This is a sample Dockerfile build recipe for building ASP.NET Core + instapack p
```Dockerfile
FROM node:12-slim AS instapack
RUN npm install -g instapack
# using pnpm is faster (optional)
RUN npm install -g pnpm
RUN pnpm install -g instapack
COPY . /src
WORKDIR /src/MyApp
RUN ipack

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as build
FROM mcr.microsoft.com/dotnet/sdk:5.0 as build
COPY --from=instapack /src /src
WORKDIR /src/MyApp
RUN dotnet restore
RUN dotnet publish -c Release

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 as runtime
COPY --from=build /src/MyApp/bin/Release/netcoreapp3.1/publish /app
FROM mcr.microsoft.com/dotnet/aspnet:5.0 as runtime
COPY --from=build /src/MyApp/bin/Release/net5.0/publish /app
WORKDIR /app
ENTRYPOINT ["dotnet", "MyApp.dll"]
```
Expand All @@ -759,29 +761,15 @@ services:

stages:
- build
- release

variables:
TEST_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH:$CI_COMMIT_REF_NAME
RELEASE_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH:latest

before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com

build:
stage: build
script:
- docker build --pull -t $TEST_IMAGE .
- docker push $TEST_IMAGE

release:
stage: release
script:
- docker pull $TEST_IMAGE
- docker tag $TEST_IMAGE $RELEASE_IMAGE
- docker push $RELEASE_IMAGE
only:
- master
- docker build --pull -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
```
### How to debug using Visual Studio Code?
Expand Down

0 comments on commit 6c820d6

Please sign in to comment.