コマンド一発でhttps通信できるローカル環境をDockerで作成した時のメモ。 Dockerfileの書き方で色々ハマりました。 まだよく分かってないけどとりあえず動いた。 Dockerfileは以下のような感じ FROM php:7.1-apache ADD ssl.conf /etc/apache2/sites-available/ssl.conf ADD entrypoint.sh /opt/entrypoint.sh RUN chmod a+x /opt/entrypoint.sh RUN /bin/bash -c "source /opt/entrypoint.sh /etc/apache2/ssl_keys localhost" RUN a2enmod ssl RUN a2ensite ssl CMD ["/usr/sbin/apache2ctl", "-D", "FOREG