-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
85 deletions.
There are no files selected for viewing
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,41 @@ | ||
name: Build and Publish Container | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: ["main"] | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
packages: write | ||
security-events: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Determine Version | ||
id: version | ||
shell: bash | ||
run: echo "sqlcmd=$(gh release view -R microsoft/go-sqlcmd --json tagName -q '.tagName')" >> $GITHUB_OUTPUT | ||
|
||
- name: Download sqlcmd ${{ steps.version.outputs.sqlcmd }} | ||
shell: bash | ||
run: | | ||
gh release download ${{ steps.version.outputs.sqlcmd }} --pattern sqlcmd-linux-amd64.tar.bz2 -R microsoft/go-sqlcmd | ||
tar -xjvf sqlcmd-linux-amd64.tar.bz2 | ||
- name: "Build and Publish brocksolutions/sqlcmd:${{ steps.version.outputs.sqlcmd }}" | ||
uses: brocksolutions/action-build-container@v3 | ||
with: | ||
dockerfile-path: Dockerfile | ||
image-name: sqlcmd | ||
version: ${{ steps.version.outputs.sqlcmd }} | ||
tag-latest: true | ||
push-to-registry: true |
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 |
---|---|---|
@@ -1,25 +1,28 @@ | ||
ARG DEBIAN_VERSION=11 | ||
FROM debian:$DEBIAN_VERSION-slim | ||
#------------------------------------------------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT license. | ||
#------------------------------------------------------------------------------ | ||
|
||
RUN apt-get -qqq update \ | ||
&& apt-get install -y curl apt-transport-https locales gnupg2 \ | ||
&& locale-gen "en_US.UTF-8" \ | ||
\ | ||
&& export `grep "VERSION_ID" /etc/os-release | sed -e 's/^VERSION_ID=\"/VERSION_ID=/' -e 's/\"$//'` \ | ||
&& mkdir -p /etc/apt/keyrings/ \ | ||
&& curl --fail https://packages.microsoft.com/config/debian/$VERSION_ID/prod.list | \ | ||
sed -E 's#deb\s+\[#deb [signed-by=/etc/apt/keyrings/microsoft.gpg #; t; q1' | \ | ||
tee /etc/apt/sources.list.d/microsoft.list \ | ||
&& curl --fail https://packages.microsoft.com/keys/microsoft.asc | \ | ||
gpg --verbose --yes --no-tty --batch --dearmor -o /etc/apt/keyrings/microsoft.gpg \ | ||
\ | ||
&& apt-get -qqq update \ | ||
&& apt-get install -y sqlcmd \ | ||
&& apt-get remove -y curl apt-transport-https gnupg2 \ | ||
&& rm -f /etc/apt/sources.list.d/msprod.list \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# Example: | ||
# docker run --rm microsoft/sqlcmd sqlcmd --help | ||
# | ||
|
||
## should be set after locale was generated, overwise triggers warnings | ||
ENV LANG="en_US.UTF-8" LANGUAGE="en_US.UTF-8" LC_ALL="en_US.UTF-8" | ||
FROM scratch | ||
ARG BUILD_DATE | ||
ARG PACKAGE_VERSION | ||
|
||
ENTRYPOINT ["/usr/bin/sqlcmd"] | ||
LABEL maintainer="Brock Solutions" \ | ||
org.label-schema.schema-version="1.0" \ | ||
org.label-schema.vendor="Brock Solutions" \ | ||
org.label-schema.name="SQLCMD CLI" \ | ||
org.label-schema.version=$PACKAGE_VERSION \ | ||
org.label-schema.license="https://github.com/microsoft/go-sqlcmd/blob/main/LICENSE" \ | ||
org.label-schema.description="The MSSQL SQLCMD CLI tool" \ | ||
org.label-schema.url="https://github.com/microsoft/go-sqlcmd" \ | ||
org.label-schema.usage="https://docs.microsoft.com/sql/tools/sqlcmd-utility" \ | ||
org.label-schema.build-date=$BUILD_DATE \ | ||
org.label-schema.docker.cmd="docker run -it brocksolutions/sqlcmd:$PACKAGE_VERSION" | ||
|
||
COPY ./sqlcmd /usr/bin/sqlcmd | ||
|
||
ENTRYPOINT ["sqlcmd"] |
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
This file was deleted.
Oops, something went wrong.