-1

I have a node.JS app with a MYSQL database inside a docker container to make it scale easily but I've ran into an issue.

I am using a packgage called node-lame. It uses the lame software in order to edit mp3 files inside my app. The problem is that the lame packgage is installed on my system while the app is inside the contaier.

When I try to use node lame it returns an error meaning lame isn't installed - it probably cant use packgages on the machine inside docker.

How do I pass/make lame on the machine accessible to the app inside a container or install only one single ubuntu packgage in the container?

(I don't want to run a whole version of Ubuntu inside docker just to have this one functionality)

Janez Kranjski
  • 115
  • 2
  • 10

1 Answers1

0

You can't use software on the host from inside the container. So you need to have node-lame inside the container.

Add node-lame as a dependency in your package.json file and it'll be installed when your Dockerfile does RUN npm install.

To install lame, add the following line to your Dockerfile

RUN apt update && apt install -y lame
Hans Kilian
  • 18,948
  • 1
  • 26
  • 35
  • I did RUN npm install in the docker file but the module itself(node-lame) is dependant on lame(the normal Ubuntu software). It needs lame installed on the machine to function. I have that but it can't use it because it's in a container. – Janez Kranjski Feb 22 '22 at 22:14
  • @JanezKranjski I've added instructions on how to install lame in your container, provided it's Debian/Ubuntu based. If it doesn't work, then please add your Dockerfile to your question. – Hans Kilian Feb 22 '22 at 22:24