-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(server): remove docker-compose and cleanup #1484
Conversation
function setup() { | ||
shutdown_containers | ||
|
||
podman network create -d bridge "${NET_OPEN}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worry slightly that we'll have to roll our own "docker compose" every time we need something like this w/ podman.
Is there any way we could at least surface this example for posterity? So future devs know how to do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is standard Docker networking: https://docs.docker.com/network/
There's really nothing special about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In our standup today you mentioned it took you a while to figure out how to do this. We should document the methodology so people don't have to keep re-inventing what you already invented
podman rm -f -v "${SHADOWBOX_CONTAINER}" || true | ||
podman rm -f -v "${CLIENT_CONTAINER}" || true | ||
podman network rm -f "${NET_OPEN}" || true | ||
podman network rm -f "${NET_BLOCKED}" || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I like to do for cleanups is add a consistent tag to all containers, images, and networks. Then you can remove everything by tag, e.g. docker network rm -f $(docker network ls -q --filter "label=org.getoutline.tag=${TAG}")
. (I assume podman can do the same thing?) I wonder if that could help scale this? Just a thought.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, but the integration test should be able to test the image without affecting the image building. So no labels. That could break an existing container, for instance.
However, we can probably use the names the same way. I already have the names with a prefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't realize we can set labels at run time. I thought it was build time only. We should consider that, but not for this PR.
This is ready for review now. We're sticking to Docker, but not docker-compose |
docker build --force-rm -t "${UTIL_IMAGE}" "$(dirname "$0")/util" | ||
} | ||
|
||
function shutdown_containers() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't just shutting down containers, it's also removing them. Maybe rename this function to reflect that or at least leave a comment for people less familiar with what docker rm -f
does?
In this PR: