From fa69b00bc7ffd23c4b0121f34675bf60df5eea6b Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 25 Jun 2024 08:55:28 -0700 Subject: [PATCH 1/6] remove `dotnet:0-${VARIANT}` (removed 0-) and use latest image to avoid signing expiration. Image pulled was `0-6.0-focal` from oct 3, 2023 --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c49dc84..1bf711e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ # [Choice] .NET version: 6.0-focal, 7.0-bullseye ARG VARIANT="6.0-focal" -FROM mcr.microsoft.com/devcontainers/dotnet:0-${VARIANT} +FROM mcr.microsoft.com/devcontainers/dotnet:${VARIANT} # Add .NET global tools path ENV PATH $PATH:/home/vscode/.dotnet:/home/vscode/.dotnet/tools From 4c3170477041ecf5da76955ebc138f5259c7c406 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 25 Jun 2024 11:30:24 -0700 Subject: [PATCH 2/6] update net version and add script to import msft signing keys --- .devcontainer/Dockerfile | 12 +++++++++++- .devcontainer/docker-compose.yml | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1bf711e..ec9cef0 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,10 +1,20 @@ # [Choice] .NET version: 6.0-focal, 7.0-bullseye -ARG VARIANT="6.0-focal" +#RUN curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg + +ARG VARIANT="dev-6.0-focal" FROM mcr.microsoft.com/devcontainers/dotnet:${VARIANT} # Add .NET global tools path ENV PATH $PATH:/home/vscode/.dotnet:/home/vscode/.dotnet/tools +# Import Microsoft Signing Keys +# https://learn.microsoft.com/dotnet/core/install/linux-ubuntu#unable-to-locate--some-packages-could-not-be-installed +RUN sudo apt-get install -y gpg wget \ + && wget https://packages.microsoft.com/keys/microsoft.asc \ + && cat microsoft.asc | gpg --dearmor -o microsoft.asc.gpg \ + && sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ \ + && sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg + # Install additional OS packages RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends software-properties-common diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index e658155..347fc24 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -7,7 +7,7 @@ services: dockerfile: Dockerfile args: # Update 'VARIANT' to pick a version of .NET: 6.0-focal, 7.0-bullseye - VARIANT: "6.0-focal" + VARIANT: "dev-6.0-focal" volumes: - ..:/workspace:cached From c463b91079a81e5c09f126f7b5adc20ed1e18e57 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 25 Jun 2024 14:03:52 -0700 Subject: [PATCH 3/6] update line endings? and set correct port for dab endpoint. --- .devcontainer/sql/postCreateCommand.sh | 7 +------ app/BlazorLibrary/wwwroot/appsettings.json | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.devcontainer/sql/postCreateCommand.sh b/.devcontainer/sql/postCreateCommand.sh index 43eb03a..f5c05ea 100644 --- a/.devcontainer/sql/postCreateCommand.sh +++ b/.devcontainer/sql/postCreateCommand.sh @@ -4,8 +4,8 @@ sqlfiles="false" SApassword=$1 dacpath=$2 sqlpath=$3 - echo "SELECT * FROM SYS.DATABASES" | dd of=testsqlconnection.sql + for i in {1..60}; do sqlcmd -S localhost -U sa -P $SApassword -d master -i testsqlconnection.sql > /dev/null @@ -19,7 +19,6 @@ do fi done rm testsqlconnection.sql - for f in $dacpath/* do if [ $f == $dacpath/*".dacpac" ] @@ -28,7 +27,6 @@ do echo "Found dacpac $f" fi done - for f in $sqlpath/* do if [ $f == $sqlpath/*".sql" ] @@ -37,7 +35,6 @@ do echo "Found SQL file $f" fi done - if [ $sqlfiles == "true" ] then for f in $sqlpath/* @@ -49,7 +46,6 @@ then fi done fi - if [ $dacpac == "true" ] then for f in $dacpath/* @@ -62,7 +58,6 @@ then fi done fi - if [ $SApassword == "P@ssw0rd!" ] then echo "$(tput setaf 1)WARNING$(tput sgr0): you are using the default sample password. If you want to change it, execute the following command" diff --git a/app/BlazorLibrary/wwwroot/appsettings.json b/app/BlazorLibrary/wwwroot/appsettings.json index 41e0341..5b5257a 100644 --- a/app/BlazorLibrary/wwwroot/appsettings.json +++ b/app/BlazorLibrary/wwwroot/appsettings.json @@ -1,3 +1,3 @@ { - "ApiUrl": "http://127.0.0.1:5001" + "ApiUrl": "http://127.0.0.1:5000" } \ No newline at end of file From cef024873a270ca938595611a18182c728774283 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 25 Jun 2024 15:12:21 -0700 Subject: [PATCH 4/6] update git attributes for sh files. --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5b5f7ed --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Git will always convert line endings to LF on checkout. +# Used for files that must keep LF endings, even on Windows. +*.sh text eol=lf \ No newline at end of file From 33771c9e13450e3f3ef4f19eb053d25b45ea0ca4 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 25 Jun 2024 15:14:01 -0700 Subject: [PATCH 5/6] revert removal of newlines. --- .devcontainer/sql/postCreateCommand.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.devcontainer/sql/postCreateCommand.sh b/.devcontainer/sql/postCreateCommand.sh index f5c05ea..2d8a238 100644 --- a/.devcontainer/sql/postCreateCommand.sh +++ b/.devcontainer/sql/postCreateCommand.sh @@ -4,6 +4,7 @@ sqlfiles="false" SApassword=$1 dacpath=$2 sqlpath=$3 + echo "SELECT * FROM SYS.DATABASES" | dd of=testsqlconnection.sql for i in {1..60}; @@ -19,6 +20,7 @@ do fi done rm testsqlconnection.sql + for f in $dacpath/* do if [ $f == $dacpath/*".dacpac" ] @@ -27,6 +29,7 @@ do echo "Found dacpac $f" fi done + for f in $sqlpath/* do if [ $f == $sqlpath/*".sql" ] @@ -35,6 +38,7 @@ do echo "Found SQL file $f" fi done + if [ $sqlfiles == "true" ] then for f in $sqlpath/* @@ -46,6 +50,7 @@ then fi done fi + if [ $dacpac == "true" ] then for f in $dacpath/* @@ -58,6 +63,7 @@ then fi done fi + if [ $SApassword == "P@ssw0rd!" ] then echo "$(tput setaf 1)WARNING$(tput sgr0): you are using the default sample password. If you want to change it, execute the following command" From 718573dac241eec399ffd77dcb1e941846906a38 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Tue, 25 Jun 2024 16:17:24 -0700 Subject: [PATCH 6/6] add git attributes for sh line endings --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5b5f7ed --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Git will always convert line endings to LF on checkout. +# Used for files that must keep LF endings, even on Windows. +*.sh text eol=lf \ No newline at end of file