【发布时间】:2019-05-03 04:06:27
【问题描述】:
可以在 Dockerfile 底部添加什么命令以在 ENNTRYPOINT 之后进入容器提示符? Dockerfile 运行正常。只是它会回到执行它的提示符。
# Pull base image
From ubuntu:18.04
LABEL maintainer="tester@gmail.com"
# Install dependencies
RUN apt-get update -y
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv
RUN apt-get install -y vim
RUN python3.6 -m pip install pip --upgrade
RUN pip3 install pytest pytest-cache
RUN pip3 install pylint
RUN pip3 install requests
# Create working directory
RUN mkdir /testsuite
# Copy project
COPY comments_categories_api /testsuite/comments_categories_api
COPY comments_posts_api /testsuite/comments_posts_api/
RUN chmod -R a+rwX testsuite/
# Set working directory
WORKDIR /testsuite
# Set Python version
RUN echo alias python='/usr/bin/python3' >> ~/.bashrc
# RUN echo cd testsuite/ >> ~/.bashrc
# Define ENTRYPOINT
COPY ./docker-entrypoint.sh /testsuite/docker-entrypoint.sh
RUN ["chmod", "+x", "/testsuite/docker-entrypoint.sh"]
ENTRYPOINT ["sh", "/testsuite/docker-entrypoint.sh"]
【问题讨论】:
-
您可以发布用于运行容器的 docker run 命令吗?
-
docker run -it vip_app:v0.1 /bin/bash
标签: python-3.x docker docker-entrypoint