Skip to content

Commit 4834603

Browse files
committed
Using RUN script instead of multiple stages because of buildah problem with composed stage name resultion (containers/buildah#4820)
1 parent 0b9a5a8 commit 4834603

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

.env

-1
This file was deleted.

Dockerfile

+15-17
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,27 @@ RUN python3.11 \
1616

1717
RUN mkdir /home/getml/.getML
1818

19-
################################################################################
20-
# getml-amd64
21-
FROM getml-base AS getml-amd64
22-
ARG GETML_ARCH=x64
23-
24-
################################################################################
25-
# getml-arm64
26-
FROM getml-base AS getml-arm64
27-
ARG GETML_ARCH=arm64
2819

2920
################################################################################
3021
# getml-demo
31-
FROM getml-${TARGETARCH} AS getml-demo
22+
FROM getml-base AS getml-demo
3223

24+
ARG TARGETARCH
3325
ARG TARGETOS
34-
ARG GETML_VERSION
35-
ARG GETML_BUCKET="https://storage.googleapis.com/static.getml.com/download"
36-
ARG GETML_ENGINE_FILE="getml-${GETML_VERSION}-${GETML_ARCH}-${TARGETOS}.tar.gz"
37-
ARG GETML_ENGINE_URL="${GETML_BUCKET}/${GETML_VERSION}/${GETML_ENGINE_FILE}"
38-
39-
RUN curl "${GETML_ENGINE_URL}" | tar -C /home/getml/.getML -xvzf -
26+
RUN \
27+
if [ "${TARGETARCH}" = "amd64" ]; then \
28+
export GETML_ARCH="x64" ;\
29+
else \
30+
export GETML_ARCH="${TARGETARCH}" ;\
31+
fi; \
32+
export GETML_VERSION=$(grep -o "^getml=.*$" requirements.txt | cut -b8-) ;\
33+
export GETML_BUCKET="https://storage.googleapis.com/static.getml.com/download" ;\
34+
export GETML_ENGINE_FILE="getml-${GETML_VERSION}-${GETML_ARCH}-${TARGETOS}.tar.gz" ;\
35+
export GETML_ENGINE_URL="${GETML_BUCKET}/${GETML_VERSION}/${GETML_ENGINE_FILE}" ;\
36+
echo "Downloading getML engine from ${GETML_ENGINE_URL}" ;\
37+
curl ${GETML_ENGINE_URL} | tar -C /home/getml/.getML -xvzf -
4038

4139
COPY --chown=getml:getml . /home/getml/demo/
4240

4341
EXPOSE 1709 8888
44-
CMD [ "/home/getml/.local/bin/jupyter", "lab", "--ip='*'", "--port=8888", "--notebook-dir='/home/getml/demo'" ]
42+
CMD [ "/home/getml/.local/bin/jupyter", "lab", "--ip='*'", "--port=8888", "--notebook-dir='/home/getml/demo'" ]

docker-compose.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ services:
44
context: ./
55
dockerfile: Dockerfile
66
target: getml-demo
7-
args:
8-
- GETML_VERSION=$GETML_VERSION
97
networks:
108
- notebooks_network
119
ports:
1210
- "1709:1709"
1311
- "8888:8888"
1412

1513
networks:
16-
notebooks_network:
14+
notebooks_network:

0 commit comments

Comments
 (0)