Conversation
|
|
||
| FROM mysql:5.7 | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends build-essential tcl curl wget vim python2.7 python3.4 python-pip python-dev python3-dev libssl-dev libcurl4-openssl-dev libmysqlclient-dev |
There was a problem hiding this comment.
Clear apt cache at the end of command
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends build-essential tcl curl wget vim python2.7 python3.4 python-pip python-dev python3-dev libssl-dev libcurl4-openssl-dev libmysqlclient-dev | ||
|
|
||
| RUN mkdir -p /tmp/redis-server |
There was a problem hiding this comment.
It's better to make redis build in single RUN instruction. No need to create huge file system layers, which you will not use
There was a problem hiding this comment.
Is it possible to combine few RUN instructions?
There was a problem hiding this comment.
nope. Any instructions like RUN, ENV, COPY... create new file system layer
| RUN update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 | ||
| RUN mkdir -p /opt/cyclops | ||
|
|
||
| COPY docker/docker-entrypoint-dev.sh /usr/bin/docker-entrypoint.sh |
There was a problem hiding this comment.
Have you any plans to create another files, like docker-entrypoint-prod.sh?
| # Instructions: | ||
| # | ||
| # Build the container: | ||
| # $ docker build --rm -t cyclops:dev -f Dockerfile.dev . |
| mysql -usentry -psentry -e "CREATE DATABASE sentry;" | ||
| mysql -usentry -psentry sentry < /opt/cyclops/tests/sentry_db.sql | ||
|
|
||
| service mysql stop |
There was a problem hiding this comment.
For unification purpose. post install runs once but service mysql start runs on every run. I think that checking that mysql is running each time docker start calls is much worse than stop-start cycle on bootstrap phase.
| # Bootstrap the container: | ||
| # $ docker run --rm -d --name=cyclops-dev -v $PWD:/opt/cyclops cyclops:dev | ||
| # Run the container: | ||
| # $ docker start cyclops-dev |
There was a problem hiding this comment.
You already have running container. Docker remove it on stop
There was a problem hiding this comment.
So, you suggest remove --rm from docker run?
There was a problem hiding this comment.
No I suggest single flow. If you use --rm - no need to write instructions like start
| # Attach into the container: | ||
| # $ docker exec -it cyclops-dev bash | ||
| # Stop container: | ||
| # $ docker stop cyclops-dev |
There was a problem hiding this comment.
Remove this and next instructions, you already recommend once-running containers.
| # | ||
| # NOTE: This should not be used in production! | ||
| # | ||
| # Instructions: |
There was a problem hiding this comment.
This information should be in README or CONTRIBUTING
| @@ -0,0 +1,49 @@ | |||
| # cyclops dev environment | |||
There was a problem hiding this comment.
It's better to move your files to specific directory, for example
docker/work/Dockerfile
docker/work/root/usr/local/bin/docker-entrypoint.sh
docker/work/root/usr/local/bin/post-install.sh
There was a problem hiding this comment.
Make no sense for small deployments like this one.
There was a problem hiding this comment.
how about prod docker file? where it will be stored?
Development and testing process should be unified. Docker is a good candidate.
Build the container:
Bootstrap the container:
Run the container:
Attach into the container:
Stop container:
Remove container:
Install dependencies and run tests (after start of container and login into it):