Skip to content

Instantly share code, notes, and snippets.

@jonnyzzz
Created August 30, 2021 12:48
Show Gist options
  • Save jonnyzzz/ad70db7e9cc958ba6d4c2816d119b634 to your computer and use it in GitHub Desktop.
Save jonnyzzz/ad70db7e9cc958ba6d4c2816d119b634 to your computer and use it in GitHub Desktop.
class OpenSSLContainer : GenericContainer<OpenSSLContainer>(
ImageFromDockerfile().withDockerfileFromBuilder { it
.from("ubuntu:20.04")
.env("DEBIAN_FRONTEND", "noninteractive")
.env("LC_ALL", "C.UTF-8")
.run("apt-get update && apt-get install -y openssl")
.run("openssl version")
//we need a running container to call `execInContainer` commands
.cmd("/bin/bash -c 'while true; do sleep 10; done'")
})
//use executeInContainer command to run `openssl` calls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment