Skip to content

Commit

Permalink
Merge pull request #3 from seesharprun/build-base-image
Browse files Browse the repository at this point in the history
Pre-build devcontainer image
  • Loading branch information
seesharprun authored Aug 31, 2023
2 parents deeb97d + 6e7641c commit dd618ba
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .devcontainer/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM mcr.microsoft.com/devcontainers/dotnet:6.0-bullseye

# Install Azure Functions Core Tools
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg

RUN sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

RUN sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/debian/$(lsb_release -rs | cut -d'.' -f 1)/prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list'

RUN sudo apt-get update

RUN sudo apt-get install azure-functions-core-tools-4
23 changes: 23 additions & 0 deletions .devcontainer/base/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {
"installBicep": true,
"extensions": "cosmosdb-preview"
}
},
"containerEnv": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.vscode-dotnet-runtime",
"ms-dotnettools.csharp",
"ms-azuretools.vscode-bicep"
]
}
}
}
25 changes: 25 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Build base devcontainer image'
on:
push:
paths:
- '.devcontainer/base/**.*'
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 'Pre-build devcontainer image'
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/azure-samples/cosmos-db-design-patterns/devcontainer
cacheFrom: ghcr.io/azure-samples/cosmos-db-design-patterns/devcontainer
push: always

0 comments on commit dd618ba

Please sign in to comment.