Skip to content

Commit

Permalink
Removed fresh code cloning from building (use the local cahced versio…
Browse files Browse the repository at this point in the history
…n instead)
  • Loading branch information
simonmicro committed Sep 13, 2021
1 parent 873ee72 commit da20220
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ jobs:
- name: Build
uses: docker/build-push-action@v2
with:
context: ./docker/docker-py3-kms/
context: .
file: ./docker/docker-py3-kms/Dockerfile
platforms: linux/amd64,linux/386,linux/arm64/v8,linux/arm/v7,linux/arm/v6
push: true
tags: pykmsorg/py-kms:python3,ghcr.io/py-kms-organization/py-kms:python3
- name: Build
uses: docker/build-push-action@v2
with:
context: ./docker/docker-py3-kms-minimal/
context: .
file: ./docker/docker-py3-kms-minimal/Dockerfile
platforms: linux/amd64,linux/386,linux/arm64/v8,linux/arm/v7,linux/arm/v6
push: true
Expand Down
2 changes: 2 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Both docker files must access the source code of this repository. Therefore the build context must be the root of the project directory.
Take a look into the build script for the normal py-kms version, as it demonstrates exactly that case and how to use these docker files.
5 changes: 2 additions & 3 deletions docker/docker-py3-kms-minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ ENV LOGLEVEL INFO
ENV LOGFILE /var/log/pykms_logserver.log
ENV LOGSIZE ""

COPY ./py-kms /home/py-kms

RUN apk add --no-cache --update \
bash \
git \
Expand All @@ -25,9 +27,6 @@ RUN apk add --no-cache --update \
py3-pip \
build-base python3-dev && \
pip3 install peewee tzlocal && \
git clone https://github.com/Py-KMS-Organization/py-kms.git /tmp/py-kms && \
mv /tmp/py-kms/py-kms /home/ && \
rm -rf /tmp/py-kms && \
apk del git build-base python3-dev

WORKDIR /home/py-kms
Expand Down
6 changes: 2 additions & 4 deletions docker/docker-py3-kms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ ENV LOGLEVEL ERROR
ENV LOGFILE /var/log/pykms_logserver.log
ENV LOGSIZE ""

COPY start.sh /usr/bin/start.sh
COPY docker/docker-py3-kms/start.sh /usr/bin/start.sh
COPY ./py-kms /home/py-kms

RUN apk add --no-cache --update \
bash \
Expand All @@ -25,11 +26,8 @@ RUN apk add --no-cache --update \
sqlite-libs \
py3-pip \
build-base python3-dev && \
git clone https://github.com/Py-KMS-Organization/py-kms.git /tmp/py-kms && \
git clone https://github.com/coleifer/sqlite-web.git /tmp/sqlite_web && \
mv /tmp/py-kms/py-kms /home/ && \
mv /tmp/sqlite_web/sqlite_web /home/ && \
rm -rf /tmp/py-kms && \
rm -rf /tmp/sqlite_web && \
pip3 install peewee tzlocal pysqlite3 && \
chmod a+x /usr/bin/start.sh && \
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-py3-kms/build-py3-kms.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker build -t pykms/pykms:py3-kms . --file Dockerfile
docker build -t pykms/pykms:py3-kms ../../ --file ./Dockerfile
2 changes: 1 addition & 1 deletion docker/docker-py3-kms/run-py3-kms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ docker run -d --name py3-kms \
-e LOGSIZE=2 \
-v /etc/localtime:/etc/localtime:ro \
-v /var/log:/var/log:rw \
--restart unless-stopped pykmsorg/py-kms:python3
--restart unless-stopped pykms/pykms:py3-kms

0 comments on commit da20220

Please sign in to comment.