Skip to content

Commit

Permalink
perf: update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeEirc committed Aug 1, 2024
1 parent 401663b commit aed0a07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
11 changes: 3 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ ARG TARGETARCH
COPY . .

WORKDIR /opt/koko/ui
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=koko \
yarn build
RUN yarn build

WORKDIR /opt/koko
RUN --mount=type=cache,target=/go/pkg/mod,sharing=locked,id=koko \
set +x \
&& make build -s \
RUN make build -s \
&& set -x && ls -al . \
&& mv /opt/koko/build/koko-linux-${TARGETARCH} /opt/koko/koko \
&& mv /opt/koko/build/helm-linux-${TARGETARCH} /opt/koko/bin/helm \
Expand All @@ -31,9 +28,7 @@ ARG DEPENDENCIES=" \
ca-certificates"

ARG APT_MIRROR=http://mirrors.ustc.edu.cn
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=koko \
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=koko \
set -ex \
RUN set -ex \
&& rm -f /etc/apt/apt.conf.d/docker-clean \
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache \
&& sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile-ee
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ ARG DEPENDENCIES=" \
wget \
xz-utils"

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=koko \
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=koko \
set -ex \
RUN set -ex \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${DEPENDENCIES} \
&& apt-get clean

0 comments on commit aed0a07

Please sign in to comment.