Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

docker-compose scaling fix - #135

Merged
Razikus merged 1 commit into
opengs:docsimprovementfrom
alexander-danilenko:feature/docker-compose-scale-fix
Mar 6, 2022
Merged

Razikus merged 1 commit into
opengs:docsimprovementfrom
alexander-danilenko:feature/docker-compose-scale-fix

Conversation

@alexander-danilenko

Copy link
Copy Markdown

Description

There is --scale parameter in docker-compose (docs) that allows to start several instances of certain container. It's not working in current implementation.

Docker compose's --scale parameter is useful for running several container replicas in the same terminal window which is extremely handy for running on remote servers.

Current behavior:

After running the following command:

docker-compose up --build --scale uashield=5

I'm getting the following error:

Recreating uashield_uashield_1 ... done
Recreating uashield_uashield_2 ... error

ERROR: for uashield_uashield_2  Cannot create container for service uashield: b'Conflict. The container name "/uashield" is already in use by container "853da05e2937124032ca3398b9dcd8d2b40ec4be3d5947ac8c1e7d21b1ee2409". You have to remove (or rename) that container to be able to reuse that name.'

ERROR: for uashield  Cannot create container for service uashield: b'Conflict. The container name "/uashield" is already in use by container "853da05e2937124032ca3398b9dcd8d2b40ec4be3d5947ac8c1e7d21b1ee2409". You have to remove (or rename) that container to be able to reuse that name.'
ERROR: Encountered errors while bringing up the project.

Expected behavior

After running the following command:

docker-compose up --build --scale uashield=5

no errors need to be thrown. Containers need to be scaled to 5 running instances in parallel.

Proposed solution

Now scale parameter does not respected by docker-compose because of strictly defined container_name and image properties in uashield service. Just removing them will resolve the problem and container names for replicas will not conflict with any other replicas.

@Razikus
Razikus changed the base branch from master to docsimprovement March 6, 2022 20:55
@Razikus

Razikus commented Mar 6, 2022

Copy link
Copy Markdown
Collaborator

Looks like good small change, thanks!

@Razikus
Razikus merged commit f2ac24b into opengs:docsimprovement Mar 6, 2022
@alexander-danilenko
alexander-danilenko deleted the feature/docker-compose-scale-fix branch March 6, 2022 20:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants