Skip to content

Commit 095d866

Browse files
Remove unnecessary dependencies from DockerExecutor image (#1272)
1 parent 77d140d commit 095d866

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/smolagents/remote_executors.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,18 @@ def __init__(
218218
dockerfile_path = Path(__file__).parent / "Dockerfile"
219219
if not dockerfile_path.exists():
220220
with open(dockerfile_path, "w") as f:
221-
f.write("""FROM python:3.12-slim
222-
223-
RUN pip install jupyter_kernel_gateway requests numpy pandas
224-
RUN pip install jupyter_client notebook
225-
226-
EXPOSE 8888
227-
CMD ["jupyter", "kernelgateway", "--KernelGatewayApp.ip='0.0.0.0'", "--KernelGatewayApp.port=8888", "--KernelGatewayApp.allow_origin='*'"]
228-
""")
221+
f.write(
222+
dedent(
223+
"""\
224+
FROM python:3.12-slim
225+
226+
RUN pip install jupyter_kernel_gateway jupyter_client
227+
228+
EXPOSE 8888
229+
CMD ["jupyter", "kernelgateway", "--KernelGatewayApp.ip='0.0.0.0'", "--KernelGatewayApp.port=8888", "--KernelGatewayApp.allow_origin='*'"]
230+
"""
231+
)
232+
)
229233
_, build_logs = self.client.images.build(
230234
path=str(dockerfile_path.parent), dockerfile=str(dockerfile_path), tag=self.image_name
231235
)

0 commit comments

Comments
 (0)