Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/Dockerfile.simple
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ RUN echo Hello > /marker

EXPOSE 1234

CMD echo World >> /marker
CMD echo World >> /marker && echo "Ciao!"
11 changes: 8 additions & 3 deletions vocker
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,16 @@ class CmdOperation(Operation):
log.warn("Not supporting CMD […], copying it anyway")

env = ["export %s" % e for e in self.env if "=" in e]
cmd = "#!/bin/bash\n\n%s\n\n%s" % ("\n".join(env), self.args)
cmd = "#!/bin/bash\n\n%s\n\n%s\n" % ("\n".join(env), self.args)
ttyS0 = "#!/bin/bash\n\nif [ `tty | sed -e \"s#^.\+/##\"` == ttyS0 ]; then /etc/vocker.sh; shutdown -h now; fi\n"
log.debug("rc.local: %s" % cmd)

fish(layer.filename,
"write", "/etc/rc.d/rc.local", cmd,
"write", "/etc/vocker.sh", cmd,
":",
"sh", "chmod a+x /etc/rc.d/rc.local",
"write", "/root/.bashrc", ttyS0,
":",
"sh", "chmod a+x /etc/vocker.sh",
":",
"sh", "sed -i '/^ExecStart=/ s/$/ --autologin root/' /usr/lib/systemd/system/getty@.service /usr/lib/systemd/system/serial-getty@.service",
":",
Expand Down Expand Up @@ -345,6 +348,8 @@ if __name__ == "__main__":


with tempfile.NamedTemporaryFile("wb") as spec:
if type(xml) == str:
xml = xml.encode()
spec.write(xml)
spec.flush()
sh.virsh("define", spec.name)
Expand Down