This is an automated email from the ASF dual-hosted git repository. gk pushed a commit to branch docker in repository https://gitbox.apache.org/repos/asf/turbine-archetypes.git
commit cb760d2dcc4bdf37cbd320916e272bc61b5644d3 Merge: 443ee20 34f7c35 Author: Georg Kallidis <[email protected]> AuthorDate: Fri Feb 28 16:06:34 2020 +0100 Merge branch 'docker' of https://gitbox.apache.org/repos/asf/turbine-archetypes into docker pom.xml | 5 +++-- .../resources/archetype-resources/docker-resources/db/Dockerfile | 2 +- .../archetype-resources/docker-resources/docker-compose.yml | 7 +------ src/main/resources/archetype-resources/docker-resources/readme.md | 5 +++-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --cc src/main/resources/archetype-resources/docker-resources/db/Dockerfile index c60ad3a,555e234..8e715aa --- a/src/main/resources/archetype-resources/docker-resources/db/Dockerfile +++ b/src/main/resources/archetype-resources/docker-resources/db/Dockerfile @@@ -56,9 -56,9 +56,9 @@@ ENV MYSQL_ONETIME_PASSWORD=${MYSQL_ONET # it has been declared, those changes will be discarded. RUN ["/usr/local/bin/docker-entrypoint.sh", "mysqld", "--datadir", "/initialized-db"] --#RUN /docker-entrypoint.sh mysqld --datadir=/initialized-db && sleep 10 + -FROM mysql:latest + +FROM mysql:8.0.19 # my.cnf setting data-dir COPY --from=builder /initialized-db /var/lib/mysql diff --cc src/main/resources/archetype-resources/docker-resources/docker-compose.yml index 15bf8a2,bbe4ca2..bdf0f0c --- a/src/main/resources/archetype-resources/docker-resources/docker-compose.yml +++ b/src/main/resources/archetype-resources/docker-resources/docker-compose.yml @@@ -69,14 -71,14 +69,9 @@@ services # host: port - "13306:3306" -- #networks: -- # - db -- #command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci] command: --default-authentication-plugin=mysql_native_password volumes: #db_data: mysql_log: -- --#networks: --# db: ++ diff --cc src/main/resources/archetype-resources/docker-resources/readme.md index 7071877,2f4c711..f9c17b5 --- a/src/main/resources/archetype-resources/docker-resources/readme.md +++ b/src/main/resources/archetype-resources/docker-resources/readme.md @@@ -36,15 -36,7 +36,16 @@@ cd docker-resource ## Check Docker Compose file (optional) - - Check services in docker-compose.yml (volumes). You might map your local maven repostory like this: -- Check services in docker-compose.yml (volumes) ++- Check services in docker-compose.yml (volumes). You might map your local maven repostory like this: + +```sh + volumes: + - ../:/myapp + - '<localpath>:/m2repo' + ```yml + +- Check format: ++ ``` docker-compose config ``` @@@ -143,31 -127,6 +144,31 @@@ In the container, check ls -la /myapp // should list pom.xml ... ``` - +### Build Services + +The app service uses later a volume, which maps to the local maven repository, which you may need/not need. +The db service uses mysql (currently 8.0.x), you may replace it with a fixed release tag, e.g. 5.6. + +In any case, you need then to rebuild the image. + + + - Build the image + +```sh + docker-compose build --no-cache +``` + + .. optionally build it separately + docker-compose build --no-cache --build-arg DB_CONTEXT=./docker-resources/db db + + .. building app service first/only requires removing the dependency in docker-compose.yml(comment depends_on: db) + docker-compose build --no-cache app + +DB_CONTEXT is set to allow starting the db container standalone (in folder db, e.g. with docker build --tag my-db .) +to test it. CAVEAT: The db service is build and populated until now with hard coded data. +It is a dependency for the service app (see app/Dockerfile). + ++ # System Specific Informations ## Windows
