I am using go for the backend and angular js for the frontend of my application, and to be able to run the frontend I should run bower install first.
note: I am building my image from a centos7 base image.
I tried adding it in the docker file in the RUN command as this
WORKDIR ./Frontend
RUN bower install
I got an error:
/bin/sh: bower: command not found
does anybody knows how can I solve this?
you should haver a look at https://github.com/marmelab/docker-bower/blob/master/Dockerfile
I see, among other things
RUN apt-get install -y -qq npm
RUN ln -s /usr/bin/nodejs /usr/bin/node
# install bower
RUN npm install --global bower
This is full example how to install bower for docker with centos
Dockerfile
FROM centos
RUN useradd -ms /bin/bash bower
RUN yum install -y gcc-c++ make
RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
RUN yum install -y nodejs
# install bower
RUN npm install --global bower
USER bower
#this should show bower help - try to use install instead
RUN bower help
and in the building phase of this docker image you should see something like below. Its indicate (in the build phase) that you successfully installed bower.
Try to change help to install and also add your docker commands - WORDIR ./Frontend
etc.
Step 8 : RUN bower help
---> Running in 2afd81510166
Usage:
bower <command> [<args>] [<options>]
Commands:
cache Manage bower cache
help Display help information about Bower
home Opens a package homepage into your favorite browser
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With