我正在我的docker-compose.yml中這樣做:app: image: golang:1.14.3 ports: - "8080:8080" ## Share API port with host machine. depends_on: - broker - ffmpeg volumes: - .:/go/src/go-intelligent-monitoring-system - /home/:/home/ working_dir: /go/src/go-intelligent-monitoring-system command: apt-get install ffmpeg ########-------<<<<<<---------################# command: go run main.go 但是當(dāng)我在我的代碼上使用它時(shí),我有這個(gè)錯(cuò)誤:-->“”exec:“ffmpeg”:在$PATH中找不到可執(zhí)行文件“”
1 回答

動(dòng)漫人物
TA貢獻(xiàn)1815條經(jīng)驗(yàn) 獲得超10個(gè)贊
只有撰寫文件中的最后一個(gè)文件才會(huì)生效,因此您沒有機(jī)會(huì)使用當(dāng)前的撰寫文件安裝 ffmpeg。command
作為替代,您應(yīng)該像下面這樣安裝在自定義的 dockerfile 中,指的是:ffmpeg
app: build: ./dir
把你自定義在上面,如下圖所示:Dockerfile
dir
Dockerfile:
FROM golang:1.14.3 RUN apt-get update && apt-get install ffmpeg -y
- 1 回答
- 0 關(guān)注
- 89 瀏覽
添加回答
舉報(bào)
0/150
提交
取消