Skip to content

Commit e1a3219

Browse files
authored
Merge pull request modelcontextprotocol#24 from jkoelker/jk/container
fix(container): use noninteractive debconf
2 parents 4edf2a6 + 20a7282 commit e1a3219

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/container.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Container Image
22

33
on:
44
workflow_dispatch:
5+
pull_request:
56
push:
67
branches:
78
- main
@@ -22,6 +23,7 @@ jobs:
2223
uses: docker/setup-buildx-action@v3
2324

2425
- name: Log in to GHCR
26+
if: github.event_name != 'pull_request'
2527
uses: docker/login-action@v3
2628
with:
2729
registry: ghcr.io
@@ -41,7 +43,19 @@ jobs:
4143
flavor: |
4244
latest=true
4345
46+
- name: Build image (PR)
47+
if: github.event_name == 'pull_request'
48+
uses: docker/build-push-action@v5
49+
with:
50+
context: .
51+
file: Containerfile
52+
load: true
53+
platforms: linux/amd64
54+
tags: ${{ steps.meta.outputs.tags }}
55+
labels: ${{ steps.meta.outputs.labels }}
56+
4457
- name: Build and push
58+
if: github.event_name != 'pull_request'
4559
uses: docker/build-push-action@v5
4660
with:
4761
context: .

Containerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
FROM python:3.12-slim AS builder
44

5+
ARG DEBIAN_FRONTEND=noninteractive
6+
57
ENV PYTHONDONTWRITEBYTECODE=1 \
6-
PYTHONUNBUFFERED=1
8+
PYTHONUNBUFFERED=1 \
9+
PIP_ROOT_USER_ACTION=ignore \
10+
PIP_DISABLE_PIP_VERSION_CHECK=1
711

812
WORKDIR /app
913

@@ -22,8 +26,12 @@ RUN pip install --no-cache-dir --upgrade pip \
2226

2327
FROM python:3.12-slim AS runtime
2428

29+
ARG DEBIAN_FRONTEND=noninteractive
30+
2531
ENV PYTHONDONTWRITEBYTECODE=1 \
26-
PYTHONUNBUFFERED=1
32+
PYTHONUNBUFFERED=1 \
33+
PIP_ROOT_USER_ACTION=ignore \
34+
PIP_DISABLE_PIP_VERSION_CHECK=1
2735

2836
# hadolint ignore=DL3008
2937
RUN apt-get update \

0 commit comments

Comments
 (0)