Skip to content

Commit

Permalink
Consolidate conditional install steps into one
Browse files Browse the repository at this point in the history
  • Loading branch information
ptr727 committed Jul 1, 2022
1 parent 8f66342 commit 6f02f02
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
19 changes: 8 additions & 11 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ ENV LANG=en_US.UTF-8 \
# TODO: Build could be optimized by combining RUN layers, but that makes troubleshooting more difficult


# Conditionally install SDK and Debug tools, else just runtime
ARG DBGTOOL_INSTALL=""

# Install .NET 6 Runtime
# https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu
# TODO: Substitute ubuntu with $(lsb_release -si | tr '[:upper:]' '[:lower:]')
Expand All @@ -72,24 +69,24 @@ ENV DOTNET_RUNNING_IN_CONTAINER=true \
DOTNET_USE_POLLING_FILE_WATCHER=true \
NUGET_XMLDOC_MODE=skip

# Conditionally install SDK and Debug tools, else just runtime
# Test for empty or not empty string using -z or -n
ARG DBGTOOL_INSTALL=""

RUN wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -sr)/packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& apt-get update \
&& if [ -n "$DBGTOOL_INSTALL" ] ; then \
apt-get install -y dotnet-sdk-6.0 ; \
apt-get install -y dotnet-sdk-6.0 \
&& wget https://aka.ms/getvsdbgsh \
&& sh getvsdbgsh -v latest -l /vsdbg \
&& rm getvsdbgsh ; \
else \
apt-get install -y dotnet-runtime-6.0 ; \
fi \
&& rm packages-microsoft-prod.deb \
&& dotnet --info

# Install remote debug tools
RUN if [ -n "$DBGTOOL_INSTALL" ] ; then \
wget https://aka.ms/getvsdbgsh \
&& sh getvsdbgsh -v latest -l /vsdbg \
&& rm getvsdbgsh ; \
fi


# Install MediaInfo
# https://mediaarea.net/en/MediaInfo/Download/Ubuntu
Expand Down
1 change: 1 addition & 0 deletions PlexCleaner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ private static void WaitForDebugger()
{
Thread.Sleep(100);
}
Console.WriteLine("Debugger attached.");

// Break into the debugger
System.Diagnostics.Debugger.Break();
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ Docker images are published on [Docker Hub](https://hub.docker.com/u/ptr727/plex
## Release Notes

- Version 2.9:
- Added `--debug` option that will wait for a debugger to be attached on launch.
- `develop` docker builds will install the .NET SDK and the VsDbg .NET Debugger.
- Added remote docker container debug support.
- `develop` tagged docker builds use the `Debug` build target, and will now install the .NET SDK and the [VsDbg](https://aka.ms/getvsdbgsh) .NET Debugger.
- Added a `--debug` commandline option that will wait for a debugger to be attached on launch.
- Remote debugging in docker over SSH can be done using [VSCode](https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes) or [Visual Studio](https://docs.microsoft.com/en-us/visualstudio/debugger/attach-to-process-running-in-docker-container?view=vs-2022).
- See [Release History](./HISTORY.md) for older Release Notes.

## Questions or Issues
Expand Down

0 comments on commit 6f02f02

Please sign in to comment.