Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-readme-about-run-with-docker #84

Conversation

tamakiii
Copy link
Collaborator

@tamakiii tamakiii commented Apr 18, 2020

@tamakiii
Copy link
Collaborator Author

tamakiii commented Apr 18, 2020

🧸 sarabi-mastiff.lan:covid19-surveyor
$ docker build -t vscovid-crawler .
Sending build context to Docker daemon  3.621MB
Step 1/8 : FROM ubuntu:18.04
 ---> 4e5021d210f6
Step 2/8 : MAINTAINER TAKANO Mitsuhiro
 ---> Running in 1378573d018b
Removing intermediate container 1378573d018b
 ---> 17d9de846f00
Step 3/8 : RUN apt-get update && apt-get install -y  make  wget  jq  nginx  fcgiwrap  squid  && apt-get clean  && rm -rf /var/lib/apt/lists/*
 ---> Running in f21fa71eadbb

...

Successfully built 0fa20b856a1e
Successfully tagged vscovid-crawler:latest

🧸 sarabi-mastiff.lan:covid19-surveyor
$ echo 'environment=development' > .env

🧸 sarabi-mastiff.lan:covid19-surveyor
$ docker run -it --rm -p 8080:80 -v $(pwd):/home/ubuntu/vscovid-crawler --entrypoint /home/ubuntu/vscovid-crawler/docker/entrypoint.sh vscovid-crawler
find ./test/ -regex '.*\.sh$' | xargs -t -n1 bash
bash ./test/url-map_test.sh
actual 首相官邸ホームページ
expect 首相官邸ホームページ

@tamakiii
Copy link
Collaborator Author

🧸 sarabi-mastiff.lan:covid19-surveyor
$ docker run -it --rm -p 8080:80 -v $(pwd):/home/ubuntu/vscovid-crawler --entrypoint /home/ubuntu/vscovid-crawler/docker/entrypoint.sh vscovid-crawler
Makefile:2: .env: No such file or directory
sed: can't read .env: No such file or directory
make: *** No rule to make target '.env'.  Stop.

@tamakiii
Copy link
Collaborator Author

make install-dev とかで .env を作ってもよさそう

.PHONY: install install-dev

install:
	...

install-dev: \
	dev \
	install

dev:
	$(eval ENVIRONMENT := development)

@tamakiii
Copy link
Collaborator Author

tamakiii commented Apr 18, 2020

entrypoint.shDockerfileCOPY しておく方が一般的かなーと思う

こうしておけば --entrypoint を長々と書かなくてもいい(docker-entrypoint.sh としてよくある実装の少し手抜き版)

if [ "$1" == "" ]; then
  # main script
else
  exec "$@"
fi

@yuiseki yuiseki requested review from takano32 and smellman April 18, 2020 03:30
@tamakiii tamakiii mentioned this pull request Apr 18, 2020
Copy link
Member

@yuiseki yuiseki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

READMEの修正と空行の削除だけなのでよさそうです

@yuiseki yuiseki merged commit f390994 into arakawatomonori:master Apr 18, 2020
@tamakiii tamakiii deleted the fix-readme-about-run-with-docker branch April 18, 2020 06:32
@smellman
Copy link
Contributor

あー、READMEなおしたのsaveされてなくてコミット漏れになってたorz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants