Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.1K
Visualizações
yarn: install local package from monorepo and use it inside docker image with offline cache

My folder structure looks like this (monorepo):

project
|
+--- /api
|    |
|    +--- /.offline-cache
|    +--- /src
|    |    +--- index.js
|    |    +--- ...
|    |
|    +--- Dockerfile
|    +--- package.json
|    +--- yarn.lock
|
+--- /common
|    |
|    +--- /src
|    |    +--- index.js
|    |
|    +--- package.json
|
+--- /ui
|    |
|    +--- /.offline-cache
|    +--- /src
|    |    +--- index.js
|    |    +--- ...
|    |
|    +--- Dockerfile
|    +--- package.json
|    +--- yarn.lock
|
+--- docker-compose.yml

The offline-cache and building the docker-images for every 'service' (ui, api) are working.

Now I want to access/install the common module inside api and ui as well.
Running yarn add ./../common inside /api works and installs the module inside the api folder and adds it to package.json and yarn.lock file. But when I try to rebuild the docker-image I get an error telling me

error Package "" refers to a non-existing file '"/common"'.

that's because there is no common folder inside the docker container and the installed package isn't added to the offline-mirror :(

I can't copy the common folder to the docker-image because it is outside the build context and I don't want to publish to NPM. What else can I do to get this working?

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda