加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 如何在Dockerfile中运行bower安装?

发布时间:2020-12-17 17:02:03 所属栏目:安全 来源:网络整理
导读:我正在使用go for后端和angular js作为我的应用程序的前端,并且能够运行前端我应该先运行bower安装. 注意:我正在从centos7基础图像构建我的图像. 我尝试将其添加到RUN命令中的docker文件中 WORDIR ./FrontendRUN bower install 我收到一个错误: /bin/sh: b
我正在使用go for后端和angular js作为我的应用程序的前端,并且能够运行前端我应该先运行bower安装.

注意:我正在从centos7基础图像构建我的图像.

我尝试将其添加到RUN命令中的docker文件中

WORDIR ./Frontend
RUN bower install

我收到一个错误:

/bin/sh: bower: command not found

有谁知道我怎么解决这个问题?

解决方法

这是如何使用centos为docker安装bower的完整示例

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

在此泊坞窗图像的构建阶段,您应该看到类似下面的内容.它表明(在构建阶段)您成功安装了bower.

尝试更改安装帮助,并添加docker命令 – WORDIR ./Frontend等.

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读