-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
Β·49 lines (42 loc) Β· 1.57 KB
/
setup.sh
File metadata and controls
executable file
Β·49 lines (42 loc) Β· 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Get current user info
export USER_UID=$(id -u)
export USER_GID=$(id -g)
export USER=$(whoami)
echo "π Starting the .NET DevBench Monster Container"
echo " User: $USER (UID: $USER_UID, GID: $USER_GID)"
# Check if the dotnet-bench image exists
if ! docker image inspect "dotnet-bench:$USER" >/dev/null 2>&1; then
echo ""
echo "β Error: Docker image 'dotnet-bench:$USER' not found!"
echo ""
echo "You need to build the .NET bench image first:"
echo " ./scripts/build-layer.sh"
echo ""
echo "This will:"
echo " 1. Check that devbench-base:$USER exists (build ../base-image if needed)"
echo " 2. Build the .NET-specific layer on top of it"
exit 1
fi
# Validate we have the required info
if [ -z "$USER" ] || [ -z "$USER_UID" ] || [ -z "$USER_GID" ]; then
echo "β Error: Could not determine user info"
echo " USER=$USER, UID=$USER_UID, GID=$USER_GID"
exit 1
fi
echo "π§ Starting container with user mapping..."
# Start the container with proper user mapping (no --build since using pre-built image)
docker-compose -f .devcontainer/docker-compose.yml up -d
if [ $? -eq 0 ]; then
echo "β
Container started successfully!"
echo ""
echo "π― Next steps:"
echo " - Open VS Code and select 'Reopen in Container'"
echo " - Or run: docker exec -it dot_net_bench zsh"
echo ""
echo "π To check container status:"
echo " docker ps | grep dot_net_bench"
else
echo "β Container failed to start. Check Docker logs:"
echo " docker-compose -f .devcontainer/docker-compose.yml logs"
fi