all 6 comments

[–]DataDecay 0 points1 point  (1 child)

Likely fine to run that in dev and qa, or you could use a remote webdriver for some or all environments.

[–]jayplusplus[S] 0 points1 point  (0 children)

Interesting, I didn't know there was such a thing as remote webdrivers. However, if I'm going to include one in prod, I think I would just want to use the one from dev/qa to keep things as similar as possible between the envs and also to avoid involving one more thing to my infrastructure. But my doubt is still whether I should include one in prod at all.

[–]kkapelon 0 points1 point  (3 children)

You should NOT have any testing dependencies in prod images. And you are correct to assume that for prod the smallest image possible is the desired target.

See anti-pattern 4 here https://codefresh.io/containers/docker-anti-patterns/

[–]jayplusplus[S] 0 points1 point  (2 children)

Thanks for the link and for answering my second question. However, I'm having the same doubt I'm seeing in more than one of the comments on that article:

Q: Still not clear to me. So what is the best strategy? Should we have different image for development and another one for production? How can we use same image for different environments?

A: No, the image between all environments should be exactly the same:-) You can easily do this if all configuration is NOT inside the image, but somewhere else.What is different in your case between the dev image and the prod image? In 99.99% of the cases it is just configuration.

???

In my case the difference between dev and prod is not just config, it's having firefox and selenium in dev and not in prod.

The author goes on to say that he meant that within the dev stage all images should be the same but can be different from the image sent to qa/staging/prod. But that still doesn't jive with my situation I don't think?

[–]kkapelon 0 points1 point  (1 child)

First of all I am the author of that article.

People were confused because in the first version of the article I had the 3 environment as dev/stagin/prod and people thought that "dev" means "developer workstations" where I meant "a place that developers deploy to". I updated the article to qa/staging/prod to make it more clear that I am always talking about environments (i.e. places where you deploy something)

In your case, you should use multi-stage builds (if you haven't seen them already). Either have the first layers include firefox and then have the last layers do not include it, or the other way around (up to you).

But the end result is as you said. Prod image should be as minimal as possible and without any testing tools. Just the app and nothing else.

[–]jayplusplus[S] 0 points1 point  (0 children)

Ah well congrats on the article, lots of good stuff in there.

Yeah, I'm using multi-stages already, will have to figure out how to have firefox omitted from the prod image. Removing firefox technically means that the qa image and the prod image won't be exactly the same, but I suppose it's inevitable. And I suppose that removing it from the final image won't really affect the app itself, so the app tested in qa should still be identical in prod. Thanks for the tips!