ERROR: failed to solve: process "/bin/sh -c apt-get update (build docker for api) #4162

Closed
opened 2026-02-21 18:05:01 -05:00 by yindo · 1 comment
Owner

Originally created by @tienld-0801 on GitHub (Jun 18, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.11

Cloud or Self Hosted

Cloud, Self Hosted (Docker), Self Hosted (Source)

Steps to reproduce

Screenshot 2024-06-19 at 00 03 44

✔️ Expected Behavior

Since updating the libs of the api folder, it seems like the docker build has had a problem with line number 35 of the Dockerfile, please check and fix this !

Actual Behavior

Details of the problem from this build:

RUN apt-get update
&& apt-get install -y --no-install-recommends curl wget vim nodejs ffmpeg libgmp-dev libmpfr-dev libmpc-dev
&& apt-get autoremove
&& rm -rf /var/lib/apt/lists/*

&& rm -rf /var/lib/apt/lists/*

No response

Originally created by @tienld-0801 on GitHub (Jun 18, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.11 ### Cloud or Self Hosted Cloud, Self Hosted (Docker), Self Hosted (Source) ### Steps to reproduce <img width="1374" alt="Screenshot 2024-06-19 at 00 03 44" src="https://github.com/langgenius/dify/assets/112608271/afae22f7-554c-4fcb-8995-962ef7250e17"> ### ✔️ Expected Behavior Since updating the libs of the api folder, it seems like the docker build has had a problem with line number 35 of the Dockerfile, please check and fix this ! ### ❌ Actual Behavior Details of the problem from this build: RUN apt-get update \ && apt-get install -y --no-install-recommends curl wget vim nodejs ffmpeg libgmp-dev libmpfr-dev libmpc-dev \ && apt-get autoremove \ && rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/* _No response_
yindo added the 🐞 bug label 2026-02-21 18:05:01 -05:00
yindo closed this issue 2026-02-21 18:05:01 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 18, 2024):

The error you're encountering during the Docker build process is likely due to network or proxy settings required for apt-get to work correctly. In the Dify Docker environment, specific proxy settings are configured to handle network requests.

Ensure that the HTTP_PROXY and HTTPS_PROXY environment variables are correctly set in your Docker configuration. Here is an example from the docker-compose.yaml file:

sandbox:
  image: langgenius/dify-sandbox:0.2.1
  restart: always
  environment:
    HTTP_PROXY: 'http://ssrf_proxy:3128'
    HTTPS_PROXY: 'http://ssrf_proxy:3128'
  networks:
    - ssrf_proxy_network

Additionally, make sure the ssrf_proxy service is properly configured to handle these proxy requests:

ssrf_proxy:
  image: ubuntu/squid:latest
  restart: always
  volumes:
    - ./volumes/ssrf_proxy/squid.conf:/etc/squid/squid.conf
  networks:
    - ssrf_proxy_network
    - default

These settings ensure that all network traffic, including apt-get commands, is routed through the ssrf_proxy [1][2].

If the proxy settings are correct and the issue persists, you might want to check if there are any recent changes or updates to the base image or dependencies that could affect the apt-get commands. The base image used in the Dockerfile is mcr.microsoft.com/devcontainers/python:3.10, which uses a Debian-based system where apt-get is the appropriate package manager [3].

If you need further assistance, please provide additional logs or error messages from the Docker build process for more context.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 18, 2024): <!-- Answer --> The error you're encountering during the Docker build process is likely due to network or proxy settings required for `apt-get` to work correctly. In the Dify Docker environment, specific proxy settings are configured to handle network requests. Ensure that the `HTTP_PROXY` and `HTTPS_PROXY` environment variables are correctly set in your Docker configuration. Here is an example from the `docker-compose.yaml` file: ```yaml sandbox: image: langgenius/dify-sandbox:0.2.1 restart: always environment: HTTP_PROXY: 'http://ssrf_proxy:3128' HTTPS_PROXY: 'http://ssrf_proxy:3128' networks: - ssrf_proxy_network ``` Additionally, make sure the `ssrf_proxy` service is properly configured to handle these proxy requests: ```yaml ssrf_proxy: image: ubuntu/squid:latest restart: always volumes: - ./volumes/ssrf_proxy/squid.conf:/etc/squid/squid.conf networks: - ssrf_proxy_network - default ``` These settings ensure that all network traffic, including `apt-get` commands, is routed through the `ssrf_proxy` <sup>[[1]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.middleware.yaml)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup>. If the proxy settings are correct and the issue persists, you might want to check if there are any recent changes or updates to the base image or dependencies that could affect the `apt-get` commands. The base image used in the Dockerfile is `mcr.microsoft.com/devcontainers/python:3.10`, which uses a Debian-based system where `apt-get` is the appropriate package manager <sup>[[3]](https://github.com/langgenius/dify/blob/main/api/Dockerfile)</sup>. If you need further assistance, please provide additional logs or error messages from the Docker build process for more context. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4162