{"id":26473157,"url":"https://github.com/ragedunicorn/docker-tomcat","last_synced_at":"2026-04-20T10:03:41.503Z","repository":{"id":96252017,"uuid":"87923955","full_name":"RagedUnicorn/docker-tomcat","owner":"RagedUnicorn","description":"Repository for Docker Tomcat image based on Alpine","archived":false,"fork":false,"pushed_at":"2021-01-22T17:07:41.000Z","size":49,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T04:42:20.924Z","etag":null,"topics":["alpine","docker","tomcat"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RagedUnicorn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-11T10:59:57.000Z","updated_at":"2022-01-19T17:34:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ef866d7-2fb9-42fc-a372-068b4b44f3e3","html_url":"https://github.com/RagedUnicorn/docker-tomcat","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/RagedUnicorn/docker-tomcat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RagedUnicorn%2Fdocker-tomcat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RagedUnicorn%2Fdocker-tomcat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RagedUnicorn%2Fdocker-tomcat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RagedUnicorn%2Fdocker-tomcat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RagedUnicorn","download_url":"https://codeload.github.com/RagedUnicorn/docker-tomcat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RagedUnicorn%2Fdocker-tomcat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32042294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine","docker","tomcat"],"created_at":"2025-03-19T21:51:05.144Z","updated_at":"2026-04-20T10:03:41.467Z","avatar_url":"https://github.com/RagedUnicorn.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-tomcat\n\n\u003e A docker base image to build a container for Tomcat based on Alpine\n\nThis image is intended to build a base for providing a tomcat instance to host java applications. It depends on the baseimage `ragedunicorn/openjdk:1.3.0-jdk-stable` from [RagedUnicorn/docker-java](https://github.com/RagedUnicorn/docker-java). Make sure to locally build this image or put it in a repository.\n\n## Version\n\n* Tomcat 9\n\nFor an exact version see `Dockerfile`\n\n## Using the image\n\n#### Start container\n\nThe container can be easily started with `docker-compose` command.\n\nBy default tomcat will be reachable on `127.0.0.1:8080`\n\n```\ndocker-compose up -d\n```\n\n#### Stop container\n\nTo stop all services from the docker-compose file\n\n```\ndocker-compose down\n```\n\n### Creating a stack\n\nTo create a stack the specific `docker-compose.stack.yml` file can be used. It requires that you already built the image that is consumed by the stack or that it is available in a reachable docker repository.\n\n```\ndocker-compose build --no-cache\n```\n\n**Note:** You will get a warning that external secrets are not supported by docker-compose if you try to use this file with docker-compose.\n\n#### Join a swarm\n\n```\ndocker swarm init\n```\n\n#### Create secrets\n```\necho \"app_user\" | docker secret create com.ragedunicorn.tomcat.app_user -\necho \"app_user_password\" | docker secret create com.ragedunicorn.tomcat.app_user_password -\n```\n\n#### Deploy stack\n```\ndocker stack deploy --compose-file=docker-compose.stack.yml [stackname]\n```\n\nFor a production deployment a stack should be deployed. The secret will then be taken into account and Tomcat will be setup accordingly. You can also set a password in `conf\\tomcat-users.xml` but this is not recommended for production.\n\n## Dockery\n\nIn the dockery folder are some scripts that help out avoiding retyping long docker commands but are mostly intended for playing around with the container. For production docker-compose or docker stack should be used.\n\n#### Build image\n\nThe build script builds an image with a defined name\n\n```\nsh dockery/dbuild.sh\n```\n\n#### Run container\n\nRuns the built container. If the container was already run once it will `docker start` the already present container instead of using `docker run`\n\n```\nsh dockery/drun.sh\n```\n\n#### Attach container\n\nAttaching to the container after it is running\n\n```\nsh dockery/dattach.sh\n```\n\n#### Stop container\n\nStopping the running container\n\n```\nsh dockery/dstop.sh\n```\n\n## Configuration\n\n#### Default user\n\nThe Tomcat configuration is located in `config` and can be easily changed.\n\nThe default user is:\n`admin:admin`\n\nTo change this you can edit `config/tomcat-users.xml`.\n\n**Note:** This does not apply to a stack deployment. Make sure to set both password and user with docker secrets.\n\n#### Build Args\n\nThe image allows for certain arguments being overridden by build args.\n\n`TOMCAT_USER, TOMCAT_GROUP`\n\nThey all have a default value and don't have to be overridden. For details see the Dockerfile.\n\n## Healthcheck\n\nThe production and the stack image supports a simple healthcheck showing whether the container is healthy or not. This can be configured inside `docker-compose.yml` or `docker-compose.stack.yml`\n\n## Test\n\nTo do basic tests of the structure of the container use the `docker-compose.test.yml` file.\n\n`docker-compose -f docker-compose.test.yml up`\n\nFor more info see [container-test](https://github.com/RagedUnicorn/docker-container-test).\n\nTests can also be run by category such as command, fileExistence and metadata tests by starting single services in `docker-compose.test.yml`\n\n```\n# basic file existence tests\ndocker-compose -f docker-compose.test.yml up container-test\n# command tests\ndocker-compose -f docker-compose.test.yml up container-test-command\n# metadata tests\ndocker-compose -f docker-compose.test.yml up container-test-metadata\n```\n\nThe same tests are also available for the development image.\n\n```\n# basic file existence tests\ndocker-compose -f docker-compose.test.yml up container-dev-test\n# command tests\ndocker-compose -f docker-compose.test.yml up container-dev-test-command\n# metadata tests\ndocker-compose -f docker-compose.test.yml up container-dev-test-metadata\n```\n\n## Development\n\nTo debug the container and get more insight into the container use the `docker-compose.dev.yml`\nconfiguration.\n\n```\ndocker-compose -f docker-compose.dev.yml up -d\n```\n\nBy default the launchscript `/docker-entrypoint.sh` will not be used to start the Tomcat process. Instead the container will be setup to keep `stdin_open` open and allocating a pseudo `tty`. This allows for connecting to a shell and work on the container. A shell can be opened inside the container with `docker attach [container-id]`. Tomcat itself can be started with `./docker-entrypoint.sh`.\n\nThe Tomcat server also exposes jmx access on port `60334` when built with the developer configuration. To connect to the server use a tool like jconsole and its url `127.0.0.1:60334`\n\n## Links\n\nAlpine packages database\n- https://pkgs.alpinelinux.org/packages\n\n## License\n\nCopyright (C) 2021 Michael Wiesendanger\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fragedunicorn%2Fdocker-tomcat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fragedunicorn%2Fdocker-tomcat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fragedunicorn%2Fdocker-tomcat/lists"}