Open michaeldelago opened 1 year ago
It's a start, I guess
$ docker image ls --filter "reference=acore/*:docker-multi-stage"
REPOSITORY TAG IMAGE ID CREATED SIZE
acore/ac-wotlk-tools docker-multi-stage fa5bbb946c35 14 minutes ago 189MB
acore/ac-wotlk-authserver docker-multi-stage 5c1df1171a49 14 minutes ago 168MB
acore/ac-wotlk-worldserver docker-multi-stage 7bb0f8dbe993 14 minutes ago 769MB
acore/ac-wotlk-db-import docker-multi-stage 3ae4da780017 14 minutes ago 160MB
acore/ac-wotlk-client-data docker-multi-stage 30b1bc69f7c5 15 minutes ago 93.3MB
Whole set of images totals out to 1379MB
$ docker image ls --filter "reference=acore/*:docker-multi-stage" --format '{{ .Size }}' | \
awk '{s+=$1} END {print s}'
1379.3
Compared to images created by standard build in master
$ docker image ls --filter "reference=acore/*:master"
REPOSITORY TAG IMAGE ID CREATED SIZE
acore/ac-wotlk-worldserver-local master a8da0781742d 2 days ago 1.49GB
acore/ac-wotlk-authserver-local master 71afd9658085 2 days ago 1.49GB
acore/ac-wotlk-dev-server master 9f49a08584eb 2 days ago 3.71GB
...
$ docker image ls --filter "reference=acore/*:master" --format '{{ .Size }}' | \
awk '{s+=$1} END {print s}'
6.69 # GB
I haven't tested these initial images yet, I expect there to be changes needed that make them larger
Hitlist and things that I think would help simplify the docker install. Please feel free to note what you'd prefer to be different
Note that this is mostly my own goals/interest for this and don't necessarily reflect AzerothCore as a whole
./acore.sh docker build
) builds images by first building a container with all the dependencies (called the dev-server) and then in that container building the binaries for the server. After this, separate worldserver and authserver containers mount those binaries. docker attach
to a container as part of the initialization process. Vaporware: Things to explore after we reinforce the base
.so
or .dll
from githubfeat(Core): Allow full administration without the console/captive shell
Do you have any ideas how we can achieve this?
Describe your feature request or suggestion in detail
Hey all!
I've been looking through the Docker build and the docker-compose.yaml, and it seems like the default Docker builds are geared around development rather than deployment. I think using containers for development is fantastic, but I also think the approach recommended in the Docker setup guide should create an environment that's understandable to people who may not be familiar with AzerothCore, but are familiar with running containerized services.
Container builds (in the standard recommended method,
./acore.sh docker build
) result in a few quite large containers:It's fair to note that container builds are layered, but I personally think that layering is a "nice to have" rather than something that should be used as a main point; some deployment environments (Namely those where the authserver and the worldserver could end up on separate servers) won't be able to benefit from layering.
Going through the
Dockerfile
itself (as well as thedocker-compose.yaml
), a few things stand out to me that may be causing bloating the containers:./data/sql
is included in the container build/data/sql
is only used for a one time initialization jobservicebase
stage includes a large amount of unneeded packagesgdb
is installed, along with the-dev
versions of many of the library dependenciesOther things I noticed in the Docker build that could be removed to reduce complexity:
source
other short shell scripts with their own includes, making it difficult at times to trace what exactly is happeningDescribe a possible solution to your feature or suggestion in detail
I think a new
Dockerfile
anddocker-compose.yaml
should be written, in order to accommodate a more minimalist docker build. Goals would include:./data/sql
in the final build./env/docker/data/.initialized
file created to prevent downloading the client data more often than is needed./acore.sh docker ...
is valuable to development, and should still work.Secondary goals:
docker-compose up --build
./acore.sh --help
or the wiki.initialized
file or another way to ensure it only happens once)Additional context
I don't intend to come across as overly-critical - it's plainly obvious that a lot of time, effort, and love has gone into the development of this corner of the project. That said, I feel like there's some parts that can be improved, and one of those is something I have experience in.
From a development standpoint, I think the docker builds are fantastic, but I don't think the (likely to be very common) use case of someone stumbling on the project and wanting to spin up an idiomatic docker-compose stack is being properly met.
I'm aware of acore-docker, though I believe that repository is in a similar boat where it seems to have too much of a focus on developing Azerothcore and less on concisely describing a standard way of deploying Azerothcore. If anything, I feel like it wouldn't be terrible archive that repo, and have docker-based deployment described in this one.
I'm new to AzerothCore development, so if it seems like I'm missing something, I probably am. Please let me know!
Edit Jan 14, 23: I forgot to mention - I've begun working on the proposed changes as of earlier in the week. Currently getting the authserver to start with a ~180MB container build.