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 docker entrypoint #85

Merged
merged 14 commits into from
Apr 18, 2020

Conversation

tamakiii
Copy link
Collaborator

@tamakiii tamakiii commented Apr 18, 2020

  • entrypoint.sh は Dockerfile で COPY しておく方が一般的
  • こうしておけば --entrypoint を長々と書かなくてもいい(docker-entrypoint.sh としてよくある実装の少し手抜き版)

#84 (comment)

@yuiseki yuiseki requested review from smellman and takano32 April 18, 2020 03:30
@tamakiii
Copy link
Collaborator Author

🧸 sarabi-mastiff.lan:covid19-surveyor
$ docker build -t vscovid-crawler .
Sending build context to Docker daemon  3.676MB
Step 1/12 : FROM ubuntu:18.04
...
Successfully built 89728f0d0223
Successfully tagged vscovid-crawler:latest

🧸 sarabi-mastiff.lan:covid19-surveyor
$ docker run -it --rm -v $(pwd):/app -p 8080:80 vscovid-crawler bash -c 'pwd'
/app

🧸 sarabi-mastiff.lan:covid19-surveyor
$ docker run -it --rm -v $(pwd):/app -p 8080:80 vscovid-crawler
make: Entering directory '/app'
find ./test/ -regex '.*\.sh$' | xargs -t -n1 bash
bash ./test/url-map_test.sh

@tamakiii
Copy link
Collaborator Author

🧸 sarabi-mastiff.lan:covid19-surveyor
$ docker-compose build
Building vscovid-crawler
Step 1/11 : FROM ubuntu:18.04
...
Successfully built b83de3bb6b0b
Successfully tagged covid19-surveyor_vscovid-crawler:latest

🧸 sarabi-mastiff.lan:covid19-surveyor
$ docker-compose up
Recreating covid19-surveyor_vscovid-crawler_1 ... done
Attaching to covid19-surveyor_vscovid-crawler_1
vscovid-crawler_1  | make: Entering directory '/app'
vscovid-crawler_1  | find ./test/ -regex '.*\.sh$' | xargs -t -n1 bash
vscovid-crawler_1  | bash ./test/url-map_test.sh
vscovid-crawler_1  | actual 首相官邸ホームページ
vscovid-crawler_1  | expect 首相官邸ホームページ

@tamakiii
Copy link
Collaborator Author

.dockerignore だけ作っておきたいので少々お待ちを〜(Draftで作っておけばよかった)

@tamakiii
Copy link
Collaborator Author

大量の成果物がプロジェクト内に生成される場合、volumeマウントしているとホストOS側に成果物が来て、Dockerfile で COPY . /app している部分で docker build が激重になるので .dockerignore に入れておきたいですが、まぁ後からでも

@tamakiii
Copy link
Collaborator Author

@yuiseki さんに Hangout でお聞きして ./tmp (see aggregate.sh) を dockerignore しておいた方がよさそう〜という話をしていた

@tamakiii
Copy link
Collaborator Author

↑ done

@tamakiii
Copy link
Collaborator Author

これが通れば Redis コンテナの追加が進められそう => tamakiii-sandbox#1

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.

たぶん大丈夫そう

@yuiseki yuiseki merged commit e756149 into arakawatomonori:master Apr 18, 2020
@tamakiii tamakiii mentioned this pull request Apr 18, 2020
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.

2 participants