Skip to content

Commit

Permalink
Build istiod deb package
Browse files Browse the repository at this point in the history
  • Loading branch information
sdake committed Aug 14, 2024
1 parent 6efee98 commit a19cece
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 31 deletions.
40 changes: 12 additions & 28 deletions platform/Dockerfiles/istiod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,45 +1,29 @@
FROM docker.io/library/debian:bookworm AS build_istiod
ARG TOOLCHAIN_REVISION=undefined
FROM artificialwisdomai/toolchain:${TOOLCHAIN_REVISION} AS istiod

ENV DEBIAN_FRONTEND="noninteractive"
ENV ISTIOD_VERSION="1.22.3"
ENV PATH="$PATH:/usr/local/go/bin"
ENV TARGET_ARCH="amd64"
ENV DEB_COMPRESSION="--deb-compression=none"
# postinst.sh may not be needed.
ENV SIDECAR_FILES="pilot-discovery istioctl envoy pilot-agent envoy_bootstrap.json istio-start.sh istio.service sidecar.env postinst.sh"
ENV BUILD_WITH_CONTAINER="0"
ENV GO_VERSION="1.22.5"


RUN apt update
RUN apt --yes install build-essential
RUN apt --yes install curl
RUN apt --yes install ruby3.1
RUN apt --yes install git
###
#
# Install fpm which is required by Istio's makefiles

RUN apt --yes install ruby3.1
RUN gem3.1 install fpm

RUN mkdir -p /workspace/source
RUN mkdir -p /workspace/build
RUN mkdir -p /workspace/target

WORKDIR /workspace/fetch
RUN curl --location https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz --remote-name
RUN tar -xf go${GO_VERSION}.linux-amd64.tar.gz
RUN mv go /usr/local

###
#
# Prepare and build cloud-hypervisor
# Prepare and build istiod

WORKDIR /workspace/source
RUN git clone --depth 1 --branch ${ISTIOD_VERSION} https://github.com/istio/istio istiod-${ISTIOD_VERSION}
WORKDIR /workspace
RUN git clone --depth 1 --branch ${ISTIOD_VERSION} https://github.com/istio/istio build

WORKDIR /workspace/source/istiod-${ISTIOD_VERSION}
WORKDIR /workspace/build
RUN make build-linux
RUN make deb

RUN cp --archive --recursive /workspace/source/istiod-${ISTIOD_VERSION}/out/linux_amd64/* /workspace/target
RUN cp --archive --recursive /workspace/build/out/linux_amd64/release/*.deb /workspace/target

FROM scratch
COPY --from=build_istiod /workspace/target /
COPY --from=istiod /workspace/target /
7 changes: 4 additions & 3 deletions platform/Dockerfiles/istiod/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ISTIOD_VERSION=v1.22.5
TOOLCHAIN_REVISION=20240813
date=$(date '+%Y%m%d%H%M%S')

docker buildx build --tag artificialwisdomai/istiod:${ISTIOD_VERSION}-${date} --output type=docker --progress plain .
docker buildx build --tag artificialwisdomai/istiod:${ISTIOD_VERSION}-${date} --output type=local,dest="${PWD}/target" --progress plain .
docker buildx build --tag artificialwisdomai/istiod:${ISTIOD_VERSION} --output type=docker --progress plain .
docker buildx build --build-arg TOOLCHAIN_REVISION=${TOOLCHAIN_REVISION} --tag artificialwisdomai/istiod:${ISTIOD_VERSION}-${date} --output type=docker --progress plain .
docker buildx build --build-arg TOOLCHAIN_REVISION=${TOOLCHAIN_REVISION} --tag artificialwisdomai/istiod:${ISTIOD_VERSION}-${date} --output type=local,dest="${PWD}/target" --progress plain .
docker buildx build --build-arg TOOLCHAIN_REVISION=${TOOLCHAIN_REVISION} --tag artificialwisdomai/istiod:${ISTIOD_VERSION} --output type=docker --progress plain .
3 changes: 3 additions & 0 deletions platform/Dockerfiles/toolchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ ENV CUDA_VERSION="12-6"
ENV RUST_VERSION="1.80.0"
ENV GO_VERSION="1.22.5"
ENV RUST_ARCH="x86_64"
ENV TARGET_ARCH="amd64"
ENV DEB_COMPRESSION="--deb-compression=none"
ENV BUILD_WITH_CONTAINER="0"

ENV PATH="$PATH:/usr/local/cuda/bin:/root/.cargo/bin:/usr/local/go/bin:/workspace/v/bin"
ENV DEBIAN_FRONTEND="noninteractive"
Expand Down

0 comments on commit a19cece

Please sign in to comment.