-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a Docker image to the GitHub packages of this repository. The image contains Python 3.10, Azure CLI, ODBC driver and Microsoft MS SQL tools. The image can then be used when running CI/CD.
- Loading branch information
Showing
4 changed files
with
79 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM python:3.10-bullseye | ||
|
||
# Setup dependencies for pyodbc | ||
RUN apt-get update && \ | ||
apt-get install -y unixodbc-dev unixodbc apt-transport-https curl lsb-release && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# enable Microsoft package repo | ||
RUN curl -sL -o mspkgs.deb https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb && \ | ||
dpkg -i mspkgs.deb && \ | ||
rm -rf mspkgs.deb | ||
|
||
# enable Azure CLI package repo | ||
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/azure-cli.list | ||
|
||
# install Microsoft packages | ||
ENV ACCEPT_EULA=Y | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
azure-cli \ | ||
msodbcsql17 \ | ||
mssql-tools && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# add sqlcmd to the path | ||
ENV PATH="$PATH:/opt/mssql-tools/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: docker | ||
directory: "/" | ||
schedule: | ||
interval: daily |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Publish Docker image for CI/CD | ||
on: | ||
push: | ||
tags: | ||
- 'docker-*' | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1.14.1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v3.7.0 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
|
||
- name: Build and push Docker images | ||
uses: docker/build-push-action@v2.10.0 | ||
with: | ||
context: "{{defaultContext}}:.github" | ||
push: true | ||
platforms: linux/amd64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |