use*_*695 4 node.js meteor docker docker-compose
这就是我如何使用nodeJS和基于ubuntu图像的meteorJS创建一个docker镜像.我将使用此图像进行一些测试.
现在我想通过docker compose这样做.但这有可能吗?我可以将这些命令转换为docker compose yml文件吗?
FROM ubuntu:16.04
COPY package.json ./
RUN apt-get update -y && \
apt-get install -yqq \
python \
build-essential \
apt-transport-https \
ca-certificates \
curl \
locales \
nodejs \
npm \
nodejs-legacy \
sudo \
git
## NodeJS and MeteorJS
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash -
RUN curl https://install.meteor.com/ | sh
## Dependencies
RUN npm install -g eslint eslint-plugin-react
RUN npm install
## Locale
ENV OS_LOCALE="en_US.UTF-8"
RUN locale-gen ${OS_LOCALE}
ENV LANG=${OS_LOCALE} LANGUAGE=en_US:en LC_ALL=${OS_LOCALE}
## User
RUN useradd ubuntu && \
usermod -aG sudo ubuntu && \
mkdir -p /builds/core/.meteor /home/ubuntu && \
chown -Rh ubuntu:ubuntu /builds/core/.meteor && \
chown -Rh ubuntu:ubuntu /home/ubuntu
USER ubuntu
Run Code Online (Sandbox Code Playgroud)
Bri*_*ket 11
Docker Compose不会替换您的Dockerfile,但您可以使用Docker Compose 从Dockerfile构建映像:
version: '3'
services:
myservice:
build:
context: /path/to/Dockerfile/dir
dockerfile: Dockerfile
image: result/latest
Run Code Online (Sandbox Code Playgroud)
现在你可以用它构建它:
docker-compose build
Run Code Online (Sandbox Code Playgroud)
从以下开始:
docker-compose up -d
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4447 次 |
| 最近记录: |