Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +30 -11
Dockerfile
CHANGED
|
@@ -15,18 +15,37 @@ COPY requirements.txt .
|
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
# -----------------------------
|
| 18 |
-
# Install private confluence-ingestor wheel using BuildKit secret
|
| 19 |
# -----------------------------
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
# Install other dependencies
|
| 32 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
# -----------------------------
|
| 18 |
+
# Install private GitHub confluence-ingestor wheel using BuildKit secret
|
| 19 |
# -----------------------------
|
| 20 |
+
ARG GITHUB_USERNAME=chrisjcc
|
| 21 |
+
ARG GITHUB_REPO_NAME=confluence-ingestor
|
| 22 |
+
ARG WHEEL_NAME="confluence_ingestor-0.3.0-py3-none-any.whl"
|
| 23 |
+
|
| 24 |
+
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
|
| 25 |
+
GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) \
|
| 26 |
+
&& echo "β
GITHUB_TOKEN is set" \
|
| 27 |
+
&& echo "π Fetching release tag..." \
|
| 28 |
+
&& RELEASE_TAG=$(curl -s \
|
| 29 |
+
-H "Authorization: token ${GITHUB_TOKEN}" \
|
| 30 |
+
"https://api.github.com/repos/${GITHUB_USERNAME}/${GITHUB_REPO_NAME}/releases" \
|
| 31 |
+
| jq -r '.[0].tag_name') \
|
| 32 |
+
&& echo "π·οΈ Release tag: ${RELEASE_TAG}" \
|
| 33 |
+
&& ASSET_ID=$(curl -s \
|
| 34 |
+
-H "Authorization: token ${GITHUB_TOKEN}" \
|
| 35 |
+
"https://api.github.com/repos/${GITHUB_USERNAME}/${GITHUB_REPO_NAME}/releases/tags/${RELEASE_TAG}" \
|
| 36 |
+
| jq -r '.assets[] | select(.name=="'"${WHEEL_NAME}"'") | .id') \
|
| 37 |
+
&& echo "π¦ Asset ID: ${ASSET_ID}" \
|
| 38 |
+
&& echo "π₯ Downloading wheel..." \
|
| 39 |
+
&& curl -fL \
|
| 40 |
+
-H "Authorization: token ${GITHUB_TOKEN}" \
|
| 41 |
+
-H "Accept: application/octet-stream" \
|
| 42 |
+
-o /tmp/${WHEEL_NAME} \
|
| 43 |
+
"https://api.github.com/repos/${GITHUB_USERNAME}/${GITHUB_REPO_NAME}/releases/assets/${ASSET_ID}" \
|
| 44 |
+
&& echo "π¦ Installing wheel..." \
|
| 45 |
+
&& pip install --no-cache-dir /tmp/${WHEEL_NAME} \
|
| 46 |
+
&& rm -f /tmp/${WHEEL_NAME} \
|
| 47 |
+
&& echo "β
Installed ${WHEEL_NAME}"
|
| 48 |
+
|
| 49 |
|
| 50 |
# Install other dependencies
|
| 51 |
RUN pip install --no-cache-dir -r requirements.txt
|