Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

1.1K
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda