Skip to content

Commit 2dc0152

Browse files
committed
feat: example of docker labels REFS #64
adds labels that are displayed by the github container registry there are various other labels that the open container spec outlines https://github.com/opencontainers/image-spec/blob/main/annotations.md\#pre-defined-annotation-keys we should consider specifying values for the ones we think are useful note that this is pending update on documentation
1 parent cb3557c commit 2dc0152

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ RUN poetry install --no-root
3434
# uvicorn at this level so it sees the package
3535
WORKDIR /opt/
3636

37+
# Labels are used to identify the image
38+
LABEL org.opencontainers.image.source="https://github.com/anomaly/${PROJ_NAME}"
39+
LABEL org.opencontainers.image.description="A Python web server using FastAPI and Uvicorn"
40+
LABEL org.opencontainers.image.licenses="Apache-2.0"

Dockerfile.prod

+4-2
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,7 @@ COPY ./src/. .
7373
# Expose ports which is proxied via traefik
7474
EXPOSE 80
7575

76-
# ENTRYPOINT ["gunicorn", "--worker-tmp-dir=/dev/shm", "--worker-class=uvicorn.workers.UvicornWorker", "--bind=0.0.0.0:80", "labs.api:app"]
77-
# CMD []
76+
# Labels are used to identify the image
77+
LABEL org.opencontainers.image.source="https://github.com/anomaly/${PROJ_NAME}"
78+
LABEL org.opencontainers.image.description="A Python web server using FastAPI and Uvicorn"
79+
LABEL org.opencontainers.image.licenses="Apache-2.0"

0 commit comments

Comments
 (0)