CRYPTO NEWS

How do I efficiently install truffle and ganache-cli in a docker container?

Say I want to run a container with ganache-cli and truffle globally installed for dev purposes.

I have this first attempt Dockerfile

FROM node:15-alpine  RUN mkdir -p /home/node/app  WORKDIR /home/node/app  COPY . .  RUN apk add -t .gyp --no-cache git python g++ make &&     npm install -g truffle ganache-cli &&     npm install &&     apk del .gyp  ENTRYPOINT [ "/bin/sh" ] CMD [ "./entry.sh" ] 

which executes entry.sh at start:

#!/bin/bash  ganache-cli -m "test test test test test test test test test test test junk" -h 0.0.0.0 --secure &  sleep 2  truffle migrate --network develop  wait 

and this works, for sure; but I want to make the process of building the image as fast as possible. Do someone knows how can I improve this Dockerfile?

UPDATE: I am installing this Docker image within a container. There is no cache between builds because a new container is created everytime. This is know as Docker-in-Docker.

How do I efficiently install truffle and ganache-cli in a docker container?

Shopping cart
There are no products in the cart!
Continue shopping
0