-1
次のコマンドでDockerfileを実行すると、ドッカーのコンテナが起動し、すべて正常です。-i -tを使用しない限り、私のドッカーコンテナが動かないのはなぜですか?
docker run -d --name test1 660c93c32a
:私は-itせずにこのコマンドを実行すると、ドッキングウィンドウPSは何も返さないよう
docker run --name test1 -i -t 660c93c32a
しかし、コンテナが実行されて表示されません。
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
私がしようとしているのは、コンテナを実行し、後でコンテナ内のシェルをアタッチしたり開くことができることです。
問題が私のdockerfileにあるかどうかわからないので、下記のdockerfileを貼り付けてください。
############################################################
# Dockerfile to build Ubuntu/Ansible/Django
############################################################
# Set the base image to Ansible
FROM ubuntu:16.10
# File Author/Maintainer
MAINTAINER David
# Install Ansible and Related Deps #
RUN apt-get -y update && \
apt-get install -y python-yaml python-jinja2 python-httplib2 python-keyczar python-paramiko python-setuptools python-pkg-resources git python-pip
RUN mkdir /etc/ansible/
RUN echo '[local]\nlocalhost\n' > /etc/ansible/hosts
RUN mkdir /opt/ansible/
RUN git clone http://github.com/ansible/ansible.git /opt/ansible/ansible
WORKDIR /opt/ansible/ansible
RUN git submodule update --init
ENV PATH /opt/ansible/ansible/bin:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin
ENV PYTHONPATH /opt/ansible/ansible/lib
ENV ANSIBLE_LIBRARY /opt/ansible/ansible/library
# Update the repository sources list
RUN apt-get update -y
RUN apt-get install python -y
RUN apt-get install python-dev -y
RUN apt-get install python-setuptools -y
RUN apt-get install python-pip
RUN mkdir /ansible/
WORKDIR /ansible
COPY ./ansible ./
WORKDIR/
RUN ansible-playbook -c local ansible/playbooks/installdjango.yml
ENV PROJECTNAME davidswebsite
CMD django-admin startproject $PROJECTNAME
であなたのコマンドを再確認します。あなたのアップデートでは、質問の性質が完全に変わり、トピックの回答がわかりにくくなり混乱しました。 – larsks