I want to temporarily ignore ENTRYPOINT and start docker container

Asked 1 years ago, Updated 1 years ago, 37 views

There is a docker image made from a Python library for machine learning called mlflow.
I'd like to edit the contents (specifically install the ssh and install the key)

mlflow sagemaker build-and-push-container --no-push
The command created an image called mlflow-pyfunc locally.

docker run-it mlflow-pyfunc bash

Even if I try to get in with you,

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File"/miniconda/lib/python 3.7/site-packages/mlflow/models/container/_init__.py", line 53, in_init
    args = str(sys.argv)))
Exception: Unrecognized command bash, full args = ['-c', 'bash' ]

The command written in ENTRYPOINT was executed
Unable to start container

I'm not sure about the details of this ENTRYPOINT command, but
I think this image is necessary to use for the service of AWS called sagemaker, so I would like to leave it.

Is there any way to change the image in while maintaining ENTRYPOINT?

--

Add

The docker run option seems to have a way to overwrite the entry point with --entrypoint

docker run-it --name mlflow-pyfunc --entrypoint' 'mlflow-pyfunc bash-c "apt-get-y update; apt-get-y install opensh-client; apt-get-y clean"

docker cpssh_files/.mlflow-pyfunc:.ssh

I was able to install the files on the container in , but

docker commit mlflow-pyfunc mlflow-pyfunc

When reflected in the image in , the ENTRYPOINT is overwritten.
This image will no longer be used properly

docker

2022-09-30 15:03

2 Answers

I've never used ENTRYPOINT, so I'm not sure if I can leave it, but
Can't I use FROM to create another image in Dockerfile?

 FROM mlflow-pyfunc
RUN apt-get-y update; apt-get-y install open ssh-client; apt-get-y clean
COPY ssh_files/root/.ssh

docker build-t my-image.


2022-09-30 15:03

docker run is the command to create a new container.
What you want to do is run the command on the container that is running, so use docker exec.


2022-09-30 15:03

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.