コンテナの作成起動とbash
$ docker run --name centos7 -itd centos:centos7
$ docker exec -it centos7 /bin/bash
PHP7.1のインストール
epelとremiリポジトリが必要なので入れておく。
その後でremi-php71からphpをインストール
$ yum update -y && yum -y install epel-release
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
$ yum install --enablerepo=remi,remi-php71 -y php
確認
$ php -v
(PHP7を使うだけならphp7のイメージを拾ってきたほうが良いです。