Skip to content

Commit

Permalink
add --init to docker run
Browse files Browse the repository at this point in the history
fix theia-ide#195

Signed-off-by: tom-shan <swt0008411@163.com>
  • Loading branch information
tom-shan authored and dwjbosman committed Jul 24, 2019
1 parent 9229b9d commit 0a25c6c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ install:
- "travis_wait 30 sleep 1800 &"
- docker build --build-arg "version=$NPM_TAG" --build-arg "NODE_VERSION=$NODE_VERSION" --build-arg "GITHUB_TOKEN=$GITHUB_TOKEN" . -t "$IMAGE_TAG" --no-cache
- docker tag "$IMAGE_TAG" "$IMAGE:$NPM_TAG"
- docker run -d -p 0.0.0.0:4000:3000 "$IMAGE_TAG"
- docker run --init -d -p 0.0.0.0:4000:3000 "$IMAGE_TAG"

script: cd ../tests; yarn; yarn test-app-$IMAGE_NAME

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Building the image for Theia tag:

Running the image:

docker run -it -p 3000:3000 -v /myproject:/home/project theiaide/theia:v0.2.1
docker run -it --init -p 3000:3000 -v /myproject:/home/project theiaide/theia:v0.2.1

Building the next image:

Expand All @@ -22,7 +22,7 @@ Tag the image as latest:

Running the latest image:

docker run -p 3000:3000 theiaide/theia
docker run --init -p 3000:3000 theiaide/theia

Pushing images to Docker Hub:

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ This repository contains example Theia applications based on published Theia ext

At the moment Theia is still in [the active development](https://github.com/theia-ide/theia#roadmap). It is recommended to use [`theiaide/theia:next`](#typefoxtheianext) image to have a look at the current state.

This script pulls the image and runs Theia IDE on http://localhost:3000 with the current directory as a workspace.
This script pulls the image and runs Theia IDE on http://localhost:3000 with the current directory as a workspace. The option of `--init` is added to fix the [defunct process problem](https://github.com/theia-ide/theia-apps/issues/195).

docker run -it -p 3000:3000 -v "$(pwd):/home/project:cached" theiaide/theia:next
docker run -it --init -p 3000:3000 -v "$(pwd):/home/project:cached" theiaide/theia:next

You can pass additional arguments to Theia after the image name, for example to enable debugging:

docker run -it -p 3000:3000 --expose 9229 -p 9229:9229 -v "$(pwd):/home/project:cached" theiaide/theia:next --inspect=0.0.0.0:9229
docker run -it --init -p 3000:3000 --expose 9229 -p 9229:9229 -v "$(pwd):/home/project:cached" theiaide/theia:next --inspect=0.0.0.0:9229

### Image Variants

Expand Down
2 changes: 1 addition & 1 deletion theia-go-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Run on http://localhost:3000 with the current directory as a workspace:

```bash
docker run --security-opt seccomp=unconfined -e GO111MODULE=auto -it -p 3000:3000 -v "$(pwd):/home/project:cached" theiaide/theia-go:next
docker run --security-opt seccomp=unconfined -e GO111MODULE=auto -it --init -p 3000:3000 -v "$(pwd):/home/project:cached" theiaide/theia-go:next
```
**IMPORTANT**: if your host OS is different from image OS (linux-amd64) then don't mount but pull (`go get`) the project from the container to install dependencies against image OS, otherwise Go tooling won't work properly

Expand Down
4 changes: 2 additions & 2 deletions theia-python-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ docker build --build-arg version=next . -t theiaide/theia-python:next
### Run locally on Linux or OS X

```bash
docker run -it -p 3000:3000 -v "$(pwd):/home/project" theiaide/theia-python:latest
docker run -it --init -p 3000:3000 -v "$(pwd):/home/project" theiaide/theia-python:latest
```

### Push to Docker Hub
Expand All @@ -30,4 +30,4 @@ docker push theiaide/theia-python:${VERSION}

```
docker pull theiaide/theia-python:${VERSION}
```
```

0 comments on commit 0a25c6c

Please sign in to comment.