File: Dockerfile

package info (click to toggle)
microsoft-authentication-extensions-for-python 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 248 kB
  • sloc: python: 1,062; sh: 24; makefile: 7
file content (30 lines) | stat: -rw-r--r-- 1,307 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# TODO: Can this Dockerfile use multi-stage build?
# https://testdriven.io/tips/6da2d9c9-8849-4386-b7f9-13b28514ded8/
# Final size 690MB. (It would be 1.16 GB if started with python:3 as base)
FROM python:3.13-slim

# Install Generic PyGObject (sans GTK)
#The following somehow won't work:
#RUN apt-get update && apt-get install -y python3-gi python3-gi-cairo
RUN apt-get update && apt-get install -y \
  libcairo2-dev \
  libgirepository1.0-dev \
  python3-dev

# Install MSAL Extensions dependencies
# Don't know how to get container talk to dbus on host,
# so we choose to create a self-contained image by installing gnome-keyring
RUN apt-get install -y \
  gir1.2-secret-1 \
  gnome-keyring

# Not strictly necessary, but we include a pytest (which is only 3MB) to facilitate testing.
RUN pip install "pygobject>=3,<4" "pytest>=6,<7"

# Install MSAL Extensions. Upgrade the pinned version number to trigger a new image build.
RUN pip install "msal-extensions==1.2"

# This setup is inspired from https://github.com/jaraco/keyring#using-keyring-on-headless-linux-systems-in-a-docker-container
ENTRYPOINT ["dbus-run-session", "--"]
# Note: gnome-keyring-daemon needs previleged mode, therefore can not be run by a RUN command.
CMD ["sh", "-c", "echo default_secret | gnome-keyring-daemon --unlock; bash"]