-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·19 lines (15 loc) · 792 Bytes
/
Copy pathDockerfile
File metadata and controls
executable file
·19 lines (15 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# syntax = docker/dockerfile:1.0-experimental
FROM python:3-alpine
WORKDIR /app
COPY scale.py /app/scale.py
COPY requirements.txt /app/requirements.txt
RUN --mount=type=secret,id=pivnet_token \
apk update \
&& apk add curl jq \
&& rm -rf /var/cache/apk/* \
&& ACCESS=$(curl -X POST https://network.pivotal.io/api/v2/authentication/access_tokens -d '{"refresh_token":"'$(cat /run/secrets/pivnet_token)'"}' | jq -r .access_token) \
&& curl -v -L -o /usr/local/bin/tkgi -X GET https://network.pivotal.io/api/v2/products/pivotal-container-service/releases/863377/product_files/921855/download -H "Authorization: Bearer $ACCESS" \
&& chmod +x /usr/local/bin/tkgi \
&& cp /usr/local/bin/tkgi /usr/local/bin/pks \
&& pip install -r requirements.txt
ENTRYPOINT [ "python", "scale.py" ]