thisendout / cyclops

Docker-powered REPL for scripting and automation
MIT License
9 stars 3 forks source link

Add support for all Dockerfile commands #44

Open nextrevision opened 9 years ago

nextrevision commented 9 years ago

Does it make sense to make the workflow look like below?

cyclops> COPY test.txt /tmp/
cyclops> :commit
cyclops> :run COPY test2.txt /tmp/
cllunsford commented 9 years ago

My initial preference is to directly alias the commands, so:

:COPY test.txt /tmp/

for when you mean to copy

and

COPY test.txt /tmp/
:run COPY test2.txt /tmp/

would literally execute /bin/sh -c "COPY test.txt /tmp/

nextrevision commented 9 years ago

What about ephemeral COPY operations?

cllunsford commented 9 years ago

I think COPY operations (and other meta-directives like EXPOSE, CMD) have less of a need for ephemeral as default. In these cases, you'd have to just :b if you didn't like the outcome.

Or we could opt to make :COPY ephemeral by default (essentially equivalent to our existing :eval). So you would have to run

:COPY test.txt /tmp
:commit

I think it's more likely that people will COPY and then do something after that, and so the :commit is redundant. It is a bit of a pain that it wouldn't be consistent across the board. Maybe our :run for auto-commit should be changed. like:

:COPY test.txt /tmp/ <= ephemeral
:commit
or in one line:
:COPY!
or
:!COPY

We could do the same for :run and basically remove :eval

these are equivalent:
<nothing>
:run
and will need to be followed by a :commit

and these are equivalent
:!
:run!