Skip to content

Commit 6f22a47

Browse files
committed
fix sam dockerfile
1 parent 603c898 commit 6f22a47

File tree

1 file changed

+3
-2
lines changed
  • label_studio_ml/examples/segment_anything_model

1 file changed

+3
-2
lines changed

label_studio_ml/examples/segment_anything_model/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RUN --mount=type=cache,target="/var/cache/apt",sharing=locked \
2323
apt-get update; \
2424
apt-get upgrade -y; \
2525
apt install --no-install-recommends -y \
26-
wget git libopencv-dev cmake protobuf-compiler execstack; \
26+
wget git libopencv-dev cmake protobuf-compiler binutils; \
2727
apt-get autoremove -y
2828

2929
# Copy and run the model download script
@@ -46,8 +46,9 @@ RUN --mount=type=cache,target=${PIP_CACHE_DIR},sharing=locked \
4646
pip install -r requirements.txt
4747

4848
# Fix executable stack issue with onnxruntime shared library
49+
# Remove the .note.GNU-stack section which marks the stack as executable
4950
RUN PYTHON_VER=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')") && \
50-
find /usr/local/lib/python${PYTHON_VER}/site-packages/onnxruntime/capi -name "onnxruntime_pybind11_state*.so" -exec execstack -c {} \; 2>/dev/null || true
51+
find /usr/local/lib/python${PYTHON_VER}/site-packages/onnxruntime/capi -name "onnxruntime_pybind11_state*.so" -exec sh -c 'objcopy --remove-section .note.GNU-stack "$1" 2>/dev/null || true' _ {} \; || true
5152

5253
# install test requirements if needed
5354
COPY requirements-test.txt .

0 commit comments

Comments
 (0)