Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: failed to solve: process "/bin/sh -c sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list" did not complete successfully #8

Open
zhenzi0322 opened this issue May 31, 2024 · 1 comment

Comments

@zhenzi0322
Copy link

➜ docker-compose up
Building pptcopilot-backend
[+] Building 1.8s (7/15)                                                                                                                                                            docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                          0.0s
 => => transferring dockerfile: 1.26kB                                                                                                                                                        0.0s
 => [internal] load .dockerignore                                                                                                                                                             0.0s
 => => transferring context: 2B                                                                                                                                                               0.0s
 => [internal] load metadata for docker.io/library/golang:1.20                                                                                                                                1.5s
 => [ 1/11] FROM docker.io/library/golang:1.20@sha256:8f9af7094d0cb27cc783c697ac5ba25efdc4da35f8526db21f7aebb0b0b4f18a                                                                        0.0s
 => [internal] load build context                                                                                                                                                             0.0s
 => => transferring context: 6.25kB                                                                                                                                                           0.0s
 => CACHED [ 2/11] WORKDIR /home/tmp                                                                                                                                                          0.0s
 => ERROR [ 3/11] RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list                                                                                                   0.2s
------                                                                                                                                                                                             
 > [ 3/11] RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list:
0.204 sed: can't read /etc/apt/sources.list: No such file or directory
------
Dockerfile:6
--------------------
   4 |     # 安装mysql-client
   5 |     # 换源 
   6 | >>> RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
   7 |     #RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
   8 |     RUN apt-get update -y && apt-get install -y lsb-release
--------------------
ERROR: failed to solve: process "/bin/sh -c sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list" did not complete successfully: exit code: 2
ERROR: Service 'pptcopilot-backend' failed to build : Build failed

@LeighSu
Copy link

LeighSu commented Aug 11, 2024

golang1:20 is updated to use debian 12, and the source.list should be /etc/apt/sources.list.d/debian.sources

sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants