Skip to content

Commit

Permalink
feat: in container debugging [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurice Faber committed Aug 31, 2021
1 parent 32504ba commit 94a330a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 21 deletions.
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/docker-existing-dockerfile
{
"name": "Existing Dockerfile",

// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile",

// Set *default* container specific settings.json values on container create.
"settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": []

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
1 change: 1 addition & 0 deletions .vscode/extensions.json
Expand Up @@ -11,6 +11,7 @@
"mads-hartmann.bash-ide-vscode",
"ms-azuretools.vscode-docker",
"ms-kubernetes-tools.vscode-kubernetes-tools",
"ms-vscode-remote.remote-containers",
"pascalreitermann93.vscode-yaml-sort",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker",
Expand Down
18 changes: 0 additions & 18 deletions .vscode/launch.json

This file was deleted.

5 changes: 3 additions & 2 deletions binzx/otomi
Expand Up @@ -276,14 +276,15 @@ if [[ $calling_args == 'server'* ]]; then
fi

mkdir -p /tmp/otomi
container_name='otomi-core-dev-container'
if [ -n "$IN_DOCKER" ]; then
$cmd
status=$?
elif [[ $calling_args == *'--get-yargs-completions'* ]]; then
docker run --rm -e SHELL=$SHELL "$otomi_tools_image" bash -c "$cmd"
docker run --name $container_name -e SHELL=$SHELL "$otomi_tools_image" bash -c "$cmd"
status=$?
else
docker run --rm --init $it \
docker run --name $container_name --init $it \
$linux_workaround \
$network \
$stack_volume \
Expand Down
2 changes: 1 addition & 1 deletion src/server/index.ts
Expand Up @@ -9,7 +9,7 @@ import { terminal } from '../common/utils'

const debug = terminal('server')
const app = express()
let server: Server
let server: Server§

export const stopServer = (): void => {
server?.close()
Expand Down

0 comments on commit 94a330a

Please sign in to comment.