1

我想在 heroku 中的 docker 映像上安装 rclone,以便能够将 Rclone 与 python 电报机器人一起使用我制作了一个 heroku.yml 文件

build:
  docker:
    worker: Dockerfile
run:
  worker: bash start.sh

并 start.sh 作为

python3 -m bot

和 Dockerfile 作为

FROM ubuntu:18.04

WORKDIR /usr/src/app
RUN docker pull rclone/rclone:latest
RUN docker run rclone/rclone:latest version
RUN chmod 777 /usr/src/app
RUN apt -qq update
RUN apt -qq install -y python3 python3-pip locales
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
COPY . .
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

CMD ["bash","start.sh"]

The command '/bin/sh -c docker pull rclone/rclone:latest' returned a non-zero code: 127我在 git bash CLI 中遇到错误

我究竟做错了什么?或者程序是什么?提前致谢!

4

1 回答 1

1
FROM ubuntu:16.04

WORKDIR /app
# line number 12 - 15 in your Dockerfile
RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment
RUN echo "LANG=en_US.UTF-8" >> /etc/environment
RUN more "/etc/environment"

RUN apt-get update
#RUN apt-get upgrade -y
#RUN apt-get dist-upgrade -y
RUN apt-get install curl htop git zip nano ncdu build-essential chrpath libssl-dev libxft-dev pkg-config glib2.0-dev libexpat1-dev gobject-introspection python-gi-dev apt-transport-https libgirepository1.0-dev libtiff5-dev libjpeg-turbo8-dev libgsf-1-dev fail2ban nginx -y

# Install Rclone
RUN curl -sL https://rclone.org/install.sh | bash
RUN rclone version

# Cleanup
RUN apt-get update && apt-get upgrade -y && apt-get autoremove -y
基于这个答案

你可以试试这个,也不要尝试在 Dockerfile 中使用 docker 命令。

于 2021-10-30T06:08:41.693 回答