diff --git a/mlflow/2.11.1/22.03-lts-sp3/Dockerfile b/mlflow/2.11.1/22.03-lts-sp3/Dockerfile index a92785f7b1ece70e1998c938d3c9c63dd982213e..8e903addfba6623e769527042750e200b9c6b4af 100644 --- a/mlflow/2.11.1/22.03-lts-sp3/Dockerfile +++ b/mlflow/2.11.1/22.03-lts-sp3/Dockerfile @@ -1,11 +1,19 @@ ARG BASE=openeuler/openeuler:22.03-lts-sp3 + FROM ${BASE} ARG VERSION=2.11.1 + RUN yum install -y python3-pip && yum clean all + RUN pip3 install mlflow==${VERSION} -i https://pypi.tuna.tsinghua.edu.cn/simple && \ groupadd --gid 10001 mlflow && \ - useradd --uid 10001 --gid mlflow --shell /bin/bash --create-home mlflow + useradd --uid 10001 --gid mlflow --shell /bin/bash --create-home mlflow && \ + mkdir -p /mlflow && \ + chown mlflow:mlflow /mlflow USER 10001 -CMD ["bash"] + +ENV MLFLOW_TRACKING_URI=/mlflow + +CMD ["mlflow", "server", "--backend-store-uri", "/mlflow", "--default-artifact-root", "/mlflow", "--host", "0.0.0.0"] diff --git a/mlflow/README.md b/mlflow/README.md index dbd5ebb23097896a6971843215ec60ad24b94709..a10b53531517e17b3203a858a1f1fd262ed746f2 100644 --- a/mlflow/README.md +++ b/mlflow/README.md @@ -10,7 +10,7 @@ # Build reference -1. Build images and push: +1. Build images and push: (you may need to replace "openeuler" with your own repo name.) ```shell docker buildx build -t "openeuler/mlflow:$TAG" --platform linux/amd64,linux/arm64 . --push ``` @@ -18,8 +18,15 @@ docker buildx build -t "openeuler/mlflow:$TAG" --platform linux/amd64,linux/arm6 We are using `buildx` in here to generate multi-arch images, see more in [Docker Buildx](https://docs.docker.com/buildx/working-with-buildx/) 2. Run: + +Specify a port in your host so that you can access the Web UI at 127.0.0.1:{YOUR_PORT}. +```shell +docker run -it --name mlflow -p {YOUR_PORT}:5000 openeuler/mlflow:{TAG} +``` + +If you want to store the data permanently, use parameter ```-v``` to specify a volume such as ```mlruns```. ```shell -docker run -it --name mlflow openeuler/mlflow:{TAG} +docker run -it --name mlflow -p {YOUR_PORT}:5000 -v mlruns:/mlflow openeuler/mlflow:{TAG} ``` # Supported tags and respective Dockerfile links