第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

DOCKER:運(yùn)行 gulp-php 網(wǎng)站時(shí)出錯(cuò)

DOCKER:運(yùn)行 gulp-php 網(wǎng)站時(shí)出錯(cuò)

PHP
慕神8447489 2023-07-15 16:46:03
我正在嘗試使用 Docker 來運(yùn)行我的 php - gulp 網(wǎng)站。這是我創(chuàng)建的樹:├── app <--------------------contains the php files├── blog-theme├── bower_components├── changelog-YYYY-MM-DD.md├── dist├── Dockerfile <-----------------------DOCKERFILE├── get-git-log.sh├── git-log.txt├── gulpfile.js <------------------all my gulp tasks are here ├── node_modules├── package.json├── package-lock.json├── README.md├── Releases├── ressources├── website_test.sh└── yarn.lockapp 文件夾包含我所有的 php 文件:app├── folder1│   └── index.php├── folder2│   └── index.php├── folder3│   └── index.php├── footer.php├── header.php└── index.php我的 gulpfile.js 包含編譯和構(gòu)建我的網(wǎng)站的所有任務(wù)。它運(yùn)作良好。我用來運(yùn)行的命令是gulp build-production && gulp serve:dist由我創(chuàng)建的任務(wù)的名稱決定的。因此,在我的 Dockerfile 中,我添加了以下幾行以使我的應(yīng)用程序在 Docker 中運(yùn)行:FROM ubuntu:16.04WORKDIR /appRUN apt-get updateRUN apt-get install -y build-essentialRUN apt-get update && apt-get install -y curlRUN curl -sL https://deb.nodesource.com/setup_8.x | bash -RUN apt-get update && apt-get install -y nodejsRUN npm install -g npmRUN npm install -g nRUN n 13.6.0RUN npm i gulp@4.0.2RUN npm i gulp-cliVOLUME ["/app"]CMD ["gulp build-production && gulp serve:dist"]當(dāng)我運(yùn)行時(shí),docker build -t myapp .所有步驟都運(yùn)行良好,沒有返回任何錯(cuò)誤。但是當(dāng)我運(yùn)行時(shí)docker run myapp出現(xiàn)以下錯(cuò)誤:docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"gulp build-production && gulp serve:dist\": executable file not found in $PATH": unknown.ERRO[0001] error waiting for container: context canceled 我很困惑,所以如果有人有解決方案那就太棒了。
查看完整描述

2 回答

?
慕蓋茨4494581

TA貢獻(xiàn)1850條經(jīng)驗(yàn) 獲得超11個(gè)贊

首先,你應(yīng)該使用node鏡像而不是ubuntu,因?yàn)檫@樣你以后就不需要重新安裝它了。


我認(rèn)為你的主要問題是你應(yīng)該首先創(chuàng)建應(yīng)用程序目錄并復(fù)制所有網(wǎng)站內(nèi)容。


然后你也可以刪除VOLUME這個(gè)對你來說沒用的東西。


你可以嘗試一下:


FROM node:14


RUN mkdir /app

WORKDIR /app


COPY . /app

RUN apt update

RUN apt install -y php

RUN npm install -g n

RUN n 13.6.0

RUN npm i -g gulp-cli

RUN npm install


ENV PATH=$PATH:/app/node_modules/.bin

ENTRYPOINT [] # to bypass default node

CMD gulp serve:dist


查看完整回答
反對 回復(fù) 2023-07-15
?
慕少森

TA貢獻(xiàn)2019條經(jīng)驗(yàn) 獲得超9個(gè)贊

/app/node_modules/.bin/不在你的$PATH. 添加它ENV PATH=$PATH:/app/node_modules/.bin或在 gulp 前面添加路徑CMD ["/app/node_modules/.bin/gulp build-production && /app/node_modules/.bin/gulp serve:dist"]。



查看完整回答
反對 回復(fù) 2023-07-15
  • 2 回答
  • 0 關(guān)注
  • 172 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)