- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
这个 dockerfile 安装了 nodejs 4.2 版本,我不明白为什么。有人可以帮我安装 node 9.2 吗?我试过取出 --no install-recommends 命令无济于事。
向她添加更多文本,因为堆栈不允许我发布此问题,即使这是一个非常简单的问题,我已经在网上查看了很长时间但无济于事。向她添加更多文本,因为堆栈不允许我发布发布这个问题,尽管这是一个非常简单的问题,我已经在网上查看了很长时间但无济于事。
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y --no-install-recommends curl sudo
RUN curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
RUN apt-get install -y nodejs && \
apt-get install --yes build-essential
RUN apt-get install --yes npm
#VOLUME "/usr/local/app"
# Set up C++ dev env
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install gcc-multilib g++-multilib cmake wget -y && \
apt-get clean autoclean && \
apt-get autoremove -y
#wget -O /tmp/conan.deb -L https://github.com/conan-io/conan/releases/download/0.25.1/conan-ubuntu-64_0_25_1.deb && \
#dpkg -i /tmp/conan.deb
#ADD ./scripts/cmake-build.sh /build.sh
#RUN chmod +x /build.sh
#RUN /build.sh
RUN mkdir -p /usr/local/app
WORKDIR /usr/local/app
COPY package.json /usr/local/app
RUN ["npm", "install"]
COPY . .
RUN echo "/usr/local/app/dm" > /etc/ld.so.conf.d/mythrift.conf
RUN echo "/usr/lib/x86_64-linux-gnu" >> /etc/ld.so.conf.d/mythrift.conf
RUN echo "/usr/local/lib64" >> /etc/ld.so.conf.d/mythrift.conf
RUN ldconfig
RUN chmod +x dm/dm3
RUN ldd dm/dm3
RUN ["chmod", "+x", "dm/dm3"]
RUN ["chmod", "777", "policy"]
RUN ls -al .
RUN ["nodejs", "-v"]
CMD ["nodejs", "-v"]
最佳答案
编辑
显然,OP 运行这个版本的 ubuntu 很重要。这是一个构建在 FROM ubuntu:16.04
之上的示例:
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y --reinstall ca-certificates curl build-essential \
&& curl -s https://nodejs.org/dist/v9.9.0/node-v9.9.0-linux-x64.tar.xz \
-o node-v9.9.0-linux-x64.tar.xz && tar xf node-v9.9.0-linux-x64.tar.xz \
&& cd node-v9.9.0-linux-x64 && cp -r bin include lib share /usr/local \
&& rm -rf /node-v9.9.0-linux-x64.tar.xz /node-v9.9.0-linux-x64
CMD ["node", "-v"]
构建
docker build -t testing .
测试
docker run testing
v9.9.0
请注意,这只会处理与 Node 相关的事情,不会考虑所有其他依赖项。
关于node.js - Dockerfile ubuntu只安装node 4.2版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49329976/
我正在尝试使用谷歌云构建触发器来构建我的 docker 容器。不幸的是,构建没有找到我的 docker 文件。它不在我的存储库的根目录中,但我认为我可以指定一个相对路径。显然我配置错误了。下面是我的
我可以像这样构建一个 Dockerfile docker build -t deepak/ruby . 但是对于一个不名为Dockerfile的Dockerfile # DOCKER-VERSION
是否可以命名构建阶段?我正在搜索类似以下示例的内容: ARG NAME FROM python:3.7-alpine as modul-${NAME} # ... 如果我尝试这个例子,就会发生这个错误
在我的 Dockerfile 中,我需要使用命令替换来添加一些环境变量。我想设置 ENV PYTHONPATH /usr/local/$(python3 -c 'from distutils impo
以下Dockerfile包含四个COPY层: COPY README.md ./ COPY package.json ./ COPY gulpfile.js ./ COPY __BUILD_NUMBE
我正在尝试从我创建的 Dockerfile 中拉取 tomcat,并使用以下命令拉取 centos: FROM centos RUN docker run -it tomcat 然后现在我正在创建一个
我不确定是否应该为我的 Node.js 应用程序创建不同的 Dockerfile 文件。一种用于没有开发依赖项的生产,另一种用于包含开发依赖项的测试。 或者一个基本上是开发Dockerfile.dev
我拥有的是多个相似且简单的dockerfile 但我想要的是有一个单一的基础 dockerfile 和我的 dockerfile将他们的变量传递给它。 在我的例子中,dockerfile 之间的唯一区
我有一个应用程序有两个 Dockerfile ,说 Dockerfile.foo和 Dockerfile.bar ,预计将为 docker-compose.yml 的两个不同服务生成两个不同的图像.
我是一个 docker maven 插件新手。 如果我理解得很好,根据Spotify's Dockerfile Maven documentation ,应该将 Dockerfile 放在我的项目的根
我正在设置一个docker容器,将在this article之后在nginx服务器上为我的Angular 5应用程序提供服务。 本文提出了这个Dockerfile: # Stage 0, based
大家好, 我是 docker 的新手,我想容器化我的 ASP.NET Core 应用程序,但出现错误,我无法继续构建我的图像 这是我的示例 Dockerfile FROM microsoft/dotn
我想在不使用注册表的情况下链接 Dockerfiles,这可以通过 FROM 实现吗?陈述? 以两个 Dockerfile 为例: Dockerfile /some/other/dir/Dockerf
我尝试在公共(public) dockerhub 上通过我自己的镜像安装 Airflow,但它在本地运行完美,但当我尝试在 Openshift 上使用它时。我在下面收到此错误。 `ERROR: Cou
此 dockerfile 工作正常。但是如何在 dockerfile 中执行命令? FROM alpine RUN apk add --update sqlite && rm -rf /var/cac
当我尝试设置自动构建时,我的 Docker Hub 存储库中的 Dockerfile 为空。如果我触发构建:- Build failed: Dockerfile not found at ./Dock
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题?通过 editing this post 添加详细信息并澄清问题. 1年前关闭。 Improve this
我目前正在将一个巨大的 DockerFile 拆分为单独的 DockerFile,但是在巨大的 DockerFile 中定义的一些变量需要在单独的 DockerFile 中使用。 Docker 是否有
我有一个 Dockerfile 可以创建我想在这里使用的构建镜像:~/build/Dockerfile 然后我使用一个标准镜像来部署 从 ~/build/Dockerfile 构建的图像没有在任何地方
我运行这个: ➜ frontend git:(master) ✗ docker-compose up Building web ERROR: Cannot locate specified Dock
我是一名优秀的程序员,十分优秀!