ZenVoich / mops

Package manager for the Motoko programming language
https://mops.one
MIT License
35 stars 3 forks source link

Increase TCP timeouts #228

Open vporton opened 1 month ago

vporton commented 1 month ago

There should be a way (config file, command line flags) to increase TCP timeouts when downloading packages.

I regularly need to restart my downloading in Docker of dependencies of my software from the beginning. That is, I run docker several times instead of one.

vporton commented 1 month ago

Alternatively, you can restart download on timeouts (up to a certain number of times per package).

ZenVoich commented 1 month ago

I regularly need to restart my downloading in Docker of dependencies of my software from the beginning. That is, I run docker several times instead of one.

If you rebuild docker image on file changes, you can avoid re-downloading packages in Docker using docker build cache https://docs.docker.com/build/cache/ (also check out multi-stage builds https://docs.docker.com/build/building/multi-stage/)

  1. Add .mops folder to .dockerignore file

  2. Example Dockerfile

    FROM node:22.2.0
    WORKDIR /app
    RUN curl -fsSL cli.mops.one/install.sh | sh
    COPY mops.toml ./
    RUN mops install
    COPY . .

If you change mops.toml, packages will be downloaded on docker build.

Changing other files will not trigger downloading packages.