Skip to content

Commit a5af8a6

Browse files
author
Adrian Chang
committed
Update dockerfile
1 parent e7e63a1 commit a5af8a6

File tree

2 files changed

+95
-1
lines changed

2 files changed

+95
-1
lines changed

.github/workflows/lbox-develop.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,54 @@ jobs:
105105
uses: pypa/gh-action-pypi-publish@release/v1
106106
with:
107107
packages-dir: dist/
108-
repository-url: https://test.pypi.org/legacy/
108+
repository-url: https://test.pypi.org/legacy/
109+
test-container:
110+
runs-on: ubuntu-latest
111+
needs: ['build', 'path-filter']
112+
if: ${{ needs.path-filter.outputs.lbox == 'true' }}
113+
strategy:
114+
fail-fast: false
115+
matrix:
116+
include: ${{ fromJSON(needs.path-filter.outputs.package-matrix) }}
117+
permissions:
118+
# IMPORTANT: this permission is mandatory for trusted publishing
119+
packages: write
120+
steps:
121+
- uses: actions/checkout@v4
122+
with:
123+
ref: ${{ github.head_ref }}
124+
- name: Set up Docker Buildx
125+
uses: docker/setup-buildx-action@v3
126+
- name: Log in to the Container registry
127+
uses: docker/login-action@v3
128+
with:
129+
registry: ghcr.io
130+
username: ${{ github.actor }}
131+
password: ${{ secrets.GITHUB_TOKEN }}
132+
- name: Build and push (Develop)
133+
if: github.event_name == 'push'
134+
uses: docker/build-push-action@v5
135+
with:
136+
context: ./libs/${{ matrix.package }}
137+
file: ./libs/${{ matrix.package }}/Dockerfile
138+
github-token: ${{ secrets.GITHUB_TOKEN }}
139+
push: true
140+
platforms: |
141+
linux/amd64
142+
linux/arm64
143+
tags: |
144+
ghcr.io/${{ matrix.package }}:develop
145+
ghcr.io/${{ matrix.package }}:${{ github.sha }}
146+
- name: Build and push (Pull Request)
147+
if: github.event_name == 'pull_request'
148+
uses: docker/build-push-action@v5
149+
with:
150+
context: ./libs/${{ matrix.package }}
151+
file: ./libs/${{ matrix.package }}/Dockerfile
152+
github-token: ${{ secrets.GITHUB_TOKEN }}
153+
push: true
154+
platforms: |
155+
linux/amd64
156+
linux/arm64
157+
tags: |
158+
ghcr.io/${{ matrix.package }}:${{ github.sha }}

libs/lbox-example/Dockerfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# https://github.com/ucyo/python-package-template/blob/master/Dockerfile
2+
FROM python:3.8-slim as rye
3+
4+
ENV LANG="C.UTF-8" \
5+
LC_ALL="C.UTF-8" \
6+
PATH="/home/python/.local/bin:/home/python/.rye/shims:$PATH" \
7+
PIP_NO_CACHE_DIR="false" \
8+
RYE_VERSION="0.34.0" \
9+
RYE_INSTALL_OPTION="--yes" \
10+
LABELBOX_TEST_ENVIRON="prod"
11+
12+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
13+
ca-certificates \
14+
curl \
15+
inotify-tools \
16+
make \
17+
# cv2
18+
libsm6 \
19+
libxext6 \
20+
ffmpeg \
21+
libfontconfig1 \
22+
libxrender1 \
23+
libgl1-mesa-glx \
24+
libgeos-dev \
25+
gcc \
26+
&& rm -rf /var/lib/apt/lists/*
27+
28+
RUN groupadd --gid 1000 python && \
29+
useradd --uid 1000 --gid python --shell /bin/bash --create-home python
30+
31+
USER 1000
32+
WORKDIR /home/python/
33+
34+
RUN curl -sSf https://rye.astral.sh/get | bash -
35+
36+
COPY --chown=python:python . /home/python/labelbox-python/
37+
WORKDIR /home/python/labelbox-python
38+
39+
RUN rye config --set-bool behavior.global-python=true && \
40+
rye config --set-bool behavior.use-uv=true && \
41+
rye pin 3.8 && \
42+
rye sync
43+
44+
CMD rye run unit && rye integration

0 commit comments

Comments
 (0)