Skip to content

Commit

Permalink
dockerfile cleanup, reduce image size
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy Hughes <[email protected]>
  • Loading branch information
tchughesiv committed Nov 21, 2024
1 parent 1104753 commit 5c77936
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ build-feast-operator-docker:
# Dev images

build-feature-server-dev:
docker buildx build --build-arg VERSION=dev \
-t feastdev/feature-server:dev \
docker buildx build --build-arg VERSION=$(VERSION) \
-t $(REGISTRY)/feature-server:$(VERSION)-dev \
-f sdk/python/feast/infra/feature_servers/multicloud/Dockerfile.dev --load .

build-java-docker-dev:
Expand Down
28 changes: 12 additions & 16 deletions sdk/python/feast/infra/feature_servers/multicloud/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
FROM debian:11-slim
RUN apt update && \
apt install -y \
jq \
python3 \
python3-pip \
python3-dev \
build-essential
FROM python:3.11-slim-bullseye

RUN pip install pip --upgrade
RUN pip install "feast[aws,gcp,snowflake,redis,go,mysql,postgres,opentelemetry,grpcio]"
RUN pip install --no-cache-dir pip --upgrade
RUN pip install --no-cache-dir "feast[aws,gcp,snowflake,redis,go,mysql,postgres,opentelemetry,grpcio]"


RUN apt update
RUN apt install -y -V ca-certificates lsb-release wget
RUN wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
RUN apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
RUN apt update
RUN apt -y install libarrow-dev
RUN apt update && apt install -y -V ca-certificates lsb-release wget && \
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb && \
apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb && apt update && \
apt install -y \
jq \
libarrow-dev && \
apt remove -y lsb-release wget && \
apt-get clean && rm -rf /var/cache/apt/lists

# modify permissions to support running with a random uid
RUN mkdir -m 775 /.cache
RUN chmod g+w $(python3 -c "import feast.ui as _; print(_.__path__)" | tr -d "[']")/build/projects-list.json
38 changes: 21 additions & 17 deletions sdk/python/feast/infra/feature_servers/multicloud/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
FROM debian:11-slim
FROM python:3.11-slim-bullseye

RUN apt update && \
apt install -y \
jq \
python3 \
python3-pip \
python3-dev \
build-essential
RUN pip install --no-cache-dir pip --upgrade
RUN pip install --no-cache-dir pip-tools

RUN pip install pip --upgrade
COPY . .
RUN apt update && apt install -y -V ca-certificates lsb-release wget make git curl gcc && \
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb && \
apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb && apt update && \
apt install -y \
jq \
nodejs \
libarrow-dev && \
npm install -g yarn && \
apt remove -y lsb-release wget && \
apt-get clean && rm -rf /var/cache/apt/lists

RUN pip install "feast[aws,gcp,snowflake,redis,go,mysql,postgres,opentelemetry,grpcio]"
COPY . /feast
WORKDIR /feast
RUN make install-python-ci-dependencies && pip cache purge
ENV NPM_TOKEN '//registry.npmjs.org/:_authToken'
RUN make build-ui && yarn cache clean

WORKDIR /

RUN apt update
RUN apt install -y -V ca-certificates lsb-release wget
RUN wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
RUN apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
RUN apt update
RUN apt -y install libarrow-dev
# modify permissions to support running with a random uid
RUN mkdir -m 775 /.cache
RUN chmod g+w $(python3 -c "import feast.ui as _; print(_.__path__)" | tr -d "[']")/build/projects-list.json

0 comments on commit 5c77936

Please sign in to comment.