├── README.md ├── .gitignore ├── LICENSE └── Makefile.toml /README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | npm-debug.log 4 | temp 5 | /docs/_site 6 | target 7 | .c9 8 | *.lock 9 | .gitpod.yml 10 | Dockerfile -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Sagie Gur-Ari 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile.toml: -------------------------------------------------------------------------------- 1 | 2 | [config] 3 | skip_core_tasks = true 4 | skip_git_env_info = true 5 | skip_rust_env_info = true 6 | skip_crate_env_info = true 7 | 8 | [tasks.default] 9 | alias = "docker_cm" 10 | 11 | [tasks.docker_cm] 12 | script_runner = "@duckscript" 13 | script = ''' 14 | dockerfile = set "" 15 | fn add_docker 16 | dockerfile = set "${dockerfile}${1}\n" 17 | end 18 | 19 | add_docker "FROM debian:stable" 20 | add_docker "RUN mkdir /workdir/" 21 | add_docker "RUN mkdir /workdir/project/" 22 | add_docker "RUN apt-get update" 23 | add_docker "RUN apt-get install -y curl build-essential libssl-dev pkg-config" 24 | add_docker "ENV PATH=\"$PATH:$HOME/.cargo/bin\"" 25 | add_docker "RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" 26 | add_docker "RUN $HOME/.cargo/bin/cargo install cargo-make" 27 | add_docker "RUN $HOME/.cargo/bin/cargo make --version" 28 | add_docker "RUN echo \"cd ./workdir/project/ && ls -lsa && $HOME/.cargo/bin/cargo make hello-world\" > ./run.sh" 29 | add_docker "RUN chmod 777 ./run.sh" 30 | add_docker "ADD . /workdir/project/" 31 | add_docker "CMD [\"sh\", \"./run.sh\"]" 32 | 33 | writefile ./Dockerfile ${dockerfile} 34 | exec --fail-on-error docker build --tag cmimg:build ./ 35 | exec --fail-on-error docker run cmimg:build 36 | ''' 37 | 38 | [tasks.hello-world] 39 | command = "echo" 40 | args = ["hello", "world"] 41 | --------------------------------------------------------------------------------