Closed controlade closed 2 years ago
according to the error,
Docker Compose is now in the Docker CLI, try docker compose up
What happens when you run that? Edit: I misread the error, sorry
according to the error,
Docker Compose is now in the Docker CLI, try docker compose up
What happens when you run that? Edit: I misread the error, sorry
No problem @nailuj29gaming , thanks for replying.
For documentation purposes, here the log when using docker compose up
$ docker compose up
[+] Building 22.2s (12/16)
=> [internal] load build definition from Dockerfile.alpine 0.0s
=> => transferring dockerfile: 39B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 34B 0.0s
=> [internal] load metadata for docker.io/library/alpine:latest 1.1s
=> [internal] load metadata for docker.io/crystallang/crystal:1.0.0-alpine 1.1s
=> [internal] load build context 0.0s
=> => transferring context: 58B 0.0s
=> [build 1/6] FROM docker.io/crystallang/crystal:1.0.0-alpine@sha256:c9b59f80f6b3821596f45494cd56c3b08048067e18ff0b12c268 0.0s
=> [stage-1 1/5] FROM docker.io/library/alpine@sha256:ec14c7992a97fc11425907e908340c6c3d6ff602f5f13d899e6b7027c9b4133a 0.0s
=> CACHED [stage-1 2/5] RUN mkdir -p /opt/mint 0.0s
=> CACHED [build 2/6] RUN mkdir -p /opt/build 0.0s
=> CACHED [build 3/6] WORKDIR /opt/build 0.0s
=> CACHED [build 4/6] RUN git clone https://github.com/mint-lang/mint.git . 0.0s
=> ERROR [build 5/6] RUN shards install --ignore-crystal-version 21.0s
------
> [build 5/6] RUN shards install --ignore-crystal-version:
#11 0.203 Resolving dependencies
#11 0.203 Fetching https://github.com/mosop/string_inflection.git
#11 1.641 Fetching https://github.com/schovi/baked_file_system.git
#11 2.752 Fetching https://github.com/kemalcr/kemal.git
#11 4.403 Fetching https://github.com/luislavena/radix.git
#11 5.551 Fetching https://github.com/jeromegn/kilt.git
#11 6.681 Fetching https://github.com/crystal-loot/exception_page.git
#11 7.802 Fetching https://github.com/jwaldrip/admiral.cr.git
#11 9.165 Fetching https://github.com/gdotdesign/tree_template.git
#11 10.57 Fetching https://github.com/vladfaust/time_format.cr.git
#11 11.60 Fetching https://github.com/gdotdesign/cr-dotenv.git
#11 12.66 Fetching https://github.com/icyleaf/markd.git
#11 14.07 Fetching https://github.com/crystal-ameba/ameba.git
#11 16.53 Fetching https://github.com/makenowjust/crystal-diff.git
#11 19.78 Installing string_inflection (0.2.1)
#11 19.83 Installing baked_file_system (0.9.8 at 7183bfd)
#11 19.87 Installing radix (0.3.9)
#11 19.91 Installing kilt (0.4.0)
#11 19.94 Installing exception_page (0.1.4)
#11 19.98 Installing kemal (0.27.0)
#11 20.03 Installing admiral (1.11.2)
#11 20.07 Installing tree_template (0.1.0 at 7e24c92)
#11 20.13 Installing time_format (0.1.1)
#11 20.17 Installing dotenv (0.3.1)
#11 20.21 Installing markd (0.4.0)
#11 20.25 Installing ameba (0.14.0)
#11 20.30 Postinstall of ameba: make bin && make run_file
#11 20.94 Failed postinstall of ameba on make bin && make run_file:
#11 20.94 /usr/bin/shards build
#11 20.94 Dependencies are satisfied
#11 20.94 Building: ameba
#11 20.94 Error target ameba failed to compile:
#11 20.94 GC Warning: Failed to expand heap by 1175552 bytes
#11 20.94 GC Warning: Failed to expand heap by 1261568 bytes
#11 20.94 GC Warning: Failed to expand heap by 1347584 bytes
#11 20.94 GC Warning: Failed to expand heap by 262144 bytes
#11 20.94 GC Warning: Out of Memory! Heap size: 3 MiB. Returning NULL!
#11 20.94 Invalid memory access (signal 11) at address 0xd8
#11 20.94 [0x4000c5ebf6] ???
#11 20.94 [0x4000badab2] ???
#11 20.94 [0x4001bf5e0f] ???
#11 20.94
#11 20.94 make: *** [Makefile:8: bin/ameba] Error 1
------
The new 'docker compose' command is currently experimental. To provide feedback or request new features please open issues at https://github.com/docker/compose-cli
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c shards install --ignore-crystal-version]: exit code: 1
It seems that the container runs out of memory, you can try adding mem_reservation: 512m
, mem_limit: 1000000000
and memswap_limit: 2000000000
to the docker-compose.yml
file, more information is here https://docs.docker.com/compose/compose-file/compose-file-v2/#cpu-and-other-resources
It seems that the container runs out of memory, you can try adding
mem_reservation: 512m
,mem_limit: 1000000000
andmemswap_limit: 2000000000
to thedocker-compose.yml
file, more information is here https://docs.docker.com/compose/compose-file/compose-file-v2/#cpu-and-other-resources
Thanks for replying @gdotdesign
Result is the same after updating and running docker-compose.yml:
version: "2.4"
services:
mint:
image: mint
build:
context: ./
dockerfile: Dockerfile.alpine
volumes:
- ./workspace:/opt/mint
working_dir: /opt/mint
command: start --host 0.0.0.0
ports:
- 3000:3000
mem_limit: 1000000000
memswap_limit: 2000000000
mem_reservation: 1024m
privileged: true
Any other recommendation?
I've pushed the tag latest
to https://hub.docker.com/r/mintlang/mint/tags?page=1&ordering=last_updated you can probably use that for now.
I'll integrate pushing docker to the CI soon.
I've pushed the tag
latest
to https://hub.docker.com/r/mintlang/mint/tags?page=1&ordering=last_updated you can probably use that for now.I'll integrate pushing docker to the CI soon.
Hi @gdotdesign thanks for replying.
Here my feedback:
$ docker compose up
[+] Running 1/0
⠿ Container mint-docker_mint_1 Recreated 0.1s
Attaching to mint-docker_mint_1
mint_1 | Mint - Running the development server
mint_1 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
mint_1 | ⚙ Ensuring dependencies... 5.871ms
⚙ Parsing files... 56.374ms0 / 1
mint_1 | GC Warning: Failed to expand heap by 1187840 bytes
mint_1 | GC Warning: Failed to expand heap by 1212416 bytes
mint_1 | GC Warning: Failed to expand heap by 1232896 bytes
mint_1 | GC Warning: Failed to expand heap by 1220608 bytes
mint_1 | GC Warning: Failed to expand heap by 1277952 bytes
mint_1 | GC Warning: Failed to expand heap by 1396736 bytes
mint_1 | GC Warning: Failed to expand heap by 135168 bytes
mint_1 | GC Warning: Out of Memory! Heap size: 3 MiB. Returning NULL!
mint_1 | GC Warning: Failed to expand heap by 1396736 bytes
mint_1 | GC Warning: Failed to expand heap by 135168 bytes
mint_1 | GC Warning: Out of Memory! Heap size: 3 MiB. Returning NULL!
mint_1 | Invalid memory access (signal 11) at address 0x0
mint_1 | [0x400057b6d6] ???
mint_1 | [0x40002033f8] ???
mint_1 | [0x40007effea] ???
mint_1 | [0x4000807546] ???
mint-docker_mint_1 exited with code 11
#FROM crystallang/crystal:1.0.0-alpine AS build
FROM mintlang/mint:latest
#RUN mkdir -p /opt/build
#WORKDIR /opt/build
#RUN git clone https://github.com/mint-lang/mint.git .
#RUN shards install --ignore-crystal-version
#RUN crystal build src/mint.cr -o mint --static --release --no-debug
#FROM alpine
#RUN mkdir -p /opt/mint
#COPY --from=build /opt/build/mint /bin/mint
#COPY ./bin/entrypoint /bin/entrypoint
WORKDIR /opt/mint
ENTRYPOINT [ "/bin/entrypoint" ]
CMD [ "start" ]
I tested both, with and without memory configuration on docker-compose.yml file
It's some kind of memory issue related to Docker itself, unfortunately I'm not that versed in Docker, maybe asking in one of their forum channels would lead to a solution.
It's some kind of memory issue related to Docker itself, unfortunately I'm not that versed in Docker, maybe asking in one of their forum channels would lead to a solution.
Thank you @gdotdesign One final question: had you seen the same issue with memory before?
I am thinking that it could be due to Docker Desktop for macbook M1 chip is still under development by the Docker team, and the problem could be in a lower layer, not the image or the mint level.
It's some kind of memory issue related to Docker itself, unfortunately I'm not that versed in Docker, maybe asking in one of their forum channels would lead to a solution.
Thank you @gdotdesign One final question: had you seen the same issue with memory before?
I am thinking that it could be due to Docker Desktop for macbook M1 chip is still under development by the Docker team, and the problem could be in a lower layer, not the image or the mint level.
I didn't see it before, my gut tells me that it's an issue with Docker Desktop for macbook M1 chip as you wrote.
Not 100% sure if I have the same problem, but it looks like quite similar.
Main difference, I am not using docker.
On a Pinebook (aarch64) I get this error after shard install:
git clone ...
cd mint
shards install
mmw@PBP ~/.local/mint master shards install
Resolving dependencies
Fetching https://github.com/schovi/baked_file_system.git
Fetching https://github.com/kemalcr/kemal.git
Fetching https://github.com/luislavena/radix.git
Fetching https://github.com/crystal-loot/exception_page.git
Fetching https://github.com/sija/backtracer.cr.git
Fetching https://github.com/jwaldrip/admiral.cr.git
Fetching https://github.com/gdotdesign/cr-dotenv.git
Fetching https://github.com/icyleaf/markd.git
Fetching https://github.com/crystal-ameba/ameba.git
Installing baked_file_system (0.10.0)
Installing radix (0.4.1)
Installing backtracer (1.2.1)
Installing exception_page (0.2.2)
Installing kemal (1.1.2)
Installing admiral (1.11.5)
Installing dotenv (1.0.0)
Installing markd (0.4.2)
Installing ameba (1.0.0)
Postinstall of ameba: make bin && make run_file
Failed postinstall of ameba on make bin && make run_file:
shards build
Dependencies are satisfied
Building: ameba
Error target ameba failed to compile:
Showing last frame. Use --error-trace for full trace.
In src/ameba/inline_comments.cr:98:65
98 | Tokenizer.new(lexer).run { |t| commented = true if t.type.comment? }
^-------
Error: undefined method 'comment?' for Symbol
make: *** [Makefile:8: bin/ameba] Error 1
I am not experienced with docker, but error message looks similar and the problematic package appears to be ameba as well.
Let me know if it would be better to have a separate issue.
Any idea how to install into in an ARM Pinebook ?
From the message the issue is with ameba and not the system.
You can remove ameba from the dependencies (shards.yml), since it's for development only.
What crystal version are you using?
@MarcusE1W That's a different issue. It seems you're using an older Crystal version, which is unsupported by the Ameba linter. Try updating Crystal to v1.4.0.
Thanks. I have used the current one from Archlinux ARM. I have to check you how to update.
@MarcusE1W Since arch linux arm crystal package is one version behind, the best you can do right now is to remove ameba from shard.yml
- at least until the package gets updated.
Happy to report that mint now builds from source (without docker) on my ARM Pinebook Pro. It was really only the wrong crystal version. Sorry to have reported this wrongly in this issue, I thought they are maybe the same.
I'm closing this issue since Crystal and ameba are both m1-compatible now.
After doing:
Using Docker Desktop preview 3.3 on macOS BigSur, Apple Silicon M1:
Cannot find any reference on internet about ameba.
Anyone with a hint on what to do?
I know alternative is to compile source on the machine, but preferred method is to virtualize and homologate local environment (several for multiple developers) and against cloud environments.