Skip to content

How to check if a valid container environment is available? #1130

Answered by HofmeisterAn
tvandinther asked this question in Q&A
Discussion options

You must be logged in to vote

if the container creation fixture detects a. Non-linux OS.

What do you mean by that? The host OS, the contianer OS, the enabled engine (Linux/Windows)?

Would you wrap the container creation in a try catch and skip on exception?

I am not sure if I understood what you are trying to achieve (maybe you need to elaborate on that), but if you would like to run tests depending on the supported container OS (enabled Docker engine), you can use a similar approach to ours. We check the docker version --format '{{.Server.Os}}' response to determine whether the container runtime (host) supports Linux or Windows containers.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tvandinther
Comment options

@HofmeisterAn
Comment options

Answer selected by tvandinther
@tvandinther
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants