Skip to content

Commit

Permalink
create basic dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
phmatray committed Feb 14, 2024
1 parent 61e612e commit ad049bd
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Use the official Microsoft .NET image.
FROM mcr.microsoft.com/dotnet/sdk:8.0

# Set the working directory inside the container to /workspace.
WORKDIR /workspace

# Install system dependencies required for your project here.
# Update the package lists and install ssh and procps (which provides ps).
RUN apt-get update && apt-get install -y \
ssh \
procps \
&& rm -rf /var/lib/apt/lists/*

# Copy the solution file
COPY MasterCommander.sln .

# Copy the entire src directory and restore as distinct layers
COPY src/ ./src/
RUN for file in $(ls src/**/*.csproj); do dotnet restore $file; done

# Optionally, copy other directories if needed, e.g., for tests or additional source files.

# Set the working directory to where most of the work will be done
WORKDIR /workspace/src
19 changes: 19 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "MasterCommander Dev Container",
"build": {
"context": "..",
"dockerfile": ".devcontainer/Dockerfile"
},
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
},
"extensions": [
"ms-dotnettools.csharp"
// Add other extensions relevant to your project here
],
"forwardPorts": [
// Add any ports your application uses
],
"postCreateCommand": "dotnet restore",
"remoteUser": "root"
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Write code, not commands. MasterCommander provides a simple, consistent interfac
[![GitHub contributors](https://img.shields.io/github/contributors/phmatray/MasterCommander)](https://github.com/phmatray/MasterCommander/graphs/contributors)
[![GitHub last commit](https://img.shields.io/github/last-commit/phmatray/MasterCommander)](https://github.com/phmatray/MasterCommander/commits/master)

[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/phmatray/MasterCommander)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/bdd7b46c04534d8e958fda9dce1b0366)](https://app.codacy.com/gh/phmatray/MasterCommander/dashboard)
[![codecov](https://codecov.io/gh/phmatray/MasterCommander/branch/main/graph/badge.svg?token=041C4QKW6O)](https://app.codecov.io/gh/phmatray/MasterCommander/tree/main)

Expand Down

0 comments on commit ad049bd

Please sign in to comment.