bit-docker icon indicating copy to clipboard operation
bit-docker copied to clipboard

when i follow the Readme.md, something is wrong in harmony-docker

Open hqwuzhaoyi opened this issue 3 years ago • 14 comments

when i follow the Readme.md, something is wrong in harmony-docker

  1. run docker build . -t harmony-scope
  2. run docker run --rm --name my-scope -d -p 3000:3000 harmony-scope

only show this

68079f6304787636632a33fa593bd1a48389dfe38a5737ef5f6b7cdf5681f935

then i delete --rm

run docker run --name my-scope -d -p 3000:3000 harmony-scope

+ apt-get update
Hit:1 http://security.debian.org/debian-security stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease
Hit:3 http://deb.debian.org/debian stretch-updates InRelease
Hit:4 http://deb.debian.org/debian stretch Release
Reading package lists...
+ yarn global add $'@teambit/bit\303\237'
yarn global v1.22.5
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@teambit%2fbitß: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/usr/local/share/.config/yarn/global/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
+ bit init --bare
successfully initialized an empty bare bit scope.
+ bit start
error: component "teambit.bit/scope" was not found
consider running "bit dependents teambit.bit/scope" to understand why this component was needed

hqwuzhaoyi avatar Mar 12 '21 03:03 hqwuzhaoyi

Is there something wrong here?

# init.sh

#!/bin/bash
set -x
apt-get update

# wrong?
yarn global add @teambit/bitß

bit init --bare

bit start

hqwuzhaoyi avatar Mar 12 '21 04:03 hqwuzhaoyi

https://github.com/teambit/bit-docker/pull/5

Just a coincidence, but most likely related.

drkstr101 avatar Apr 01 '21 00:04 drkstr101

I have the same issue. Any updates?

moshekrup avatar Apr 29 '21 12:04 moshekrup

There's an extra character in the package name ß. Remove it.

olivierpilotte avatar May 20 '21 19:05 olivierpilotte

Even after removing the extra character, the bit server refuses to start.

[4/4] Building fresh packages...
success Installed "@teambit/[email protected]" with binaries:
      - bbit
Done in 11.47s.
+ bit init --bare
successfully initialized an empty bare bit scope.
+ bit start
error: component "teambit.bit/scope" was not found
consider running "bit dependents teambit.bit/scope" to understand why this component was needed

olivierpilotte avatar May 20 '21 19:05 olivierpilotte

Made some progress. In scope.jsonc, there seems to be a typo: teambit.bit/scope is wrong, should be teambit/scope

{
    "teambit/scope": {
      "description": "this is a simple demo scope for Harmony."
    }
}

olivierpilotte avatar May 20 '21 20:05 olivierpilotte

Thanks @olivierpilotte I've also been battling with bit docker for a while, unfortunately i don't think this project is fit for purpose.

samirmajen avatar May 21 '21 14:05 samirmajen

Yeah I'm trying to run it on Kubernetes. It starts but after some time it crashes with no logs / cues on what's going on.

olivierpilotte avatar May 21 '21 15:05 olivierpilotte

I managed to get it stable in docker (so should work for you in k8s) - i used your changes above and also commented out anything that needs an outbound internet connection in init.sh as we have a proxy and it appears bit doesnt support proxies. I'm using "bbit" instead of "bit" plus extra debug which as you said doesn't really show anything anyway

#!/bin/bash set -x bbit init --bare bbit start -v --log trace

samirmajen avatar May 24 '21 09:05 samirmajen

These are the full logs for the container:

+ bbit init --bare
- running command init [path]...
successfully initialized an empty bare bit scope.
+ bbit start -v --log trace
- loading bit...
- loading aspects...
- running command start [type] [pattern]...
scope.jsonc has been changed. Rebuilding UI assets for 'scope in target directory: public/bit'
(node:28) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /usr/local/share/.config/yarn/global/node_modules/@teambit/ui/node_modules/postcss/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:28) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./public/" in the "exports" field module resolution of the package at /usr/local/share/.config/yarn/global/node_modules/extract-files/package.json.
Update this package.json to use a subpath pattern like "./public/*".
Bit server has started on port 3000

It crashes right after the last line. I'm not sure what's going on.

olivierpilotte avatar May 25 '21 12:05 olivierpilotte

Here is the Dockerfile I am using for rootless Auto-DevOps, if it helps at all:

https://gitlab.com/watheia/micro/-/blob/main/Dockerfile

note: the chrome install script isn't needed for the solution.

drkstr101 avatar May 26 '21 18:05 drkstr101

@olivierpilotte this might solve your issue: https://github.com/teambit/bit-docker/issues/7

samirmajen avatar May 27 '21 08:05 samirmajen

@olivierpilotte this might solve your issue: #7

It doesn't. container still stops after some time.

abhagsain avatar Jun 08 '21 15:06 abhagsain

[Partially Working] It's working on local machine and exiting on remote digital ocean server. On my local machine (Mac) it was exiting because of some Node.js Heap Memory Issue I allocated 6GB to Docker Desktop and now it's working fine on local but not working on remote machine.

So you should check why the container is exiting through docker logs using docker logs $containerName

abhagsain avatar Jun 08 '21 17:06 abhagsain