Skip to content

Instantly share code, notes, and snippets.

@maemichi-monosense
Last active December 19, 2018 07:45
Show Gist options
  • Select an option

  • Save maemichi-monosense/5a5e937cfc27dcbab61e89901321dac1 to your computer and use it in GitHub Desktop.

Select an option

Save maemichi-monosense/5a5e937cfc27dcbab61e89901321dac1 to your computer and use it in GitHub Desktop.
PsySH docker
#! /bin/bash
repo=psysh
docker build . -t "$repo"
for v in 7 7.1 7.2 7.3; do
docker build . -t "$repo:$v" \
--build-arg php_version="$v" \
;
for l in en ja; do
tag="$v-$l"
docker build . -t "$repo:$tag" \
--build-arg php_version="$v" \
--build-arg man_lang="$l" \
;
done
done
docker image ls "$repo"
ARG php_version="latest"
FROM php:${php_version}
ARG man_lang="en"
ADD https://psysh.org/psysh /usr/local/bin/
RUN chmod +x /usr/local/bin/psysh
ENV HOME /root
ENV DOC_PATH $HOME/.local/share/psysh/
RUN mkdir -p $DOC_PATH
ENV MAN_URL http://psysh.org/manual/${man_lang}/php_manual.sqlite
ADD $MAN_URL $DOC_PATH
CMD psysh
@maemichi-monosense
Copy link
Author

bash -x build.sh

@maemichi-monosense
Copy link
Author

maemichi-monosense commented Dec 13, 2018

TODO

  • fix $HOME
  • add config file
  • alpine option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment