Skip to content

Commit

Permalink
fix docker build error
Browse files Browse the repository at this point in the history
  • Loading branch information
lkpworkspace committed Jan 14, 2024
1 parent 65d104d commit 9044e14
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docker/dev.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM docker.io/library/ubuntu:22.04
SHELL ["/bin/bash", "-c"]

ENV DEBIAN_FRONTEND noninteractive
COPY docker/ubuntu2204.sourcelist /etc/apt/sources.list
ARG cpu_arch=unknown
COPY docker/ubuntu2204_${cpu_arch}.sourcelist /etc/apt/sources.list
# RUN yes | unminimize
RUN apt update \
&& apt install -y --no-install-recommends \
Expand Down
4 changes: 4 additions & 0 deletions docker/docker_build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ function main {
fi

local arc="$(uname -m)"
local cpu_arch="unknown"
case "${arc}" in
"aarch64" | "arm64")
arc="aarch64"
cpu_arch="arm"
;;
"x86_64" | "amd64")
arc="amd64"
cpu_arch="x86"
;;
*)
echo "Unknown arch: ${arc}"
Expand All @@ -35,6 +38,7 @@ function main {

"${cmd[@]}" \
--build-arg myframe_version=$1 \
--build-arg cpu_arch=${cpu_arch} \
--ulimit nofile=102400:102400 \
-f "dev.dockerfile" \
-t "${IMAGE_NAME}:${tag}" \
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions docker/ubuntu2204_x86.sourcelist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

0 comments on commit 9044e14

Please sign in to comment.