├── .editorconfig ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── assets └── make4docker.png └── latest └── Dockerfile /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | indent_size = 2 6 | indent_style = space 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | 10 | [*.md] 11 | charset = utf-8 12 | trim_trailing_whitespace = false 13 | 14 | [{m,M}akefile] 15 | charset = utf-8 16 | indent_style = tab 17 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 6 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 7 | 8 | ## [0.0.1] - 2018-08-15 9 | ### Added 10 | - Initial release 11 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We accept contributions of every kind: documentation, code, artwork. Any help is greatly 4 | appreciated. This document contains everything needed to get started with your first contribution. 5 | 6 | 7 | ## Contributing Code 8 | 9 | We keep the source code on [GitHub](https://www.github.com) and take contributions through 10 | [GitHub pull requests](https://help.github.com/articles/using-pull-requests). 11 | 12 | For smaller patches and bug fixes just go ahead and either report an issue or submit a pull 13 | request. 14 | 15 | It is usually a good idea to discuss major changes with the developers, this will help us 16 | determine whether the contribution would be a good fit for the project and if it is likely to be 17 | accepted. There's nothing worse than seeing your hard work being rejected because it falls outside 18 | of the scope of the project. 19 | 20 | Make sure your editor respects the [EditorConfig](http://editorconfig.org) configuration file we 21 | put at the root of the repository. 22 | 23 | We follow [GitHub Flow](http://scottchacon.com/2011/08/31/github-flow.html) as our git workflow of 24 | choice which boils down to: 25 | 26 | * The `master` branch is always stable and deployable. 27 | * To work on something new, branch off `master` and give the new branch a descriptive name (e.g.: 28 | `sort-packages-by-name`, `issue-32`, etc). 29 | * Regularly __rebase__ that branch against `master` and push your work to a branch with the same 30 | name on the server. 31 | * When you need feedback, help or think you are ready, 32 | [submit a pull request](https://help.github.com/articles/using-pull-requests). 33 | * Once the branch has been merged (or rebased) into `master`, delete it from both your local and 34 | remote repository. 35 | 36 | We invite you to follow 37 | [these guidelines](http://who-t.blogspot.de/2009/12/on-commit-messages.html) to write useful 38 | commit messages. 39 | 40 | Additionally, you don't need to add entries to the [CHANGELOG.md](CHANGELOG.md) file, this is our 41 | responsibility. 42 | 43 | 44 | ## Reading List 45 | 46 | * [GitHub Flow](http://scottchacon.com/2011/08/31/github-flow.html) 47 | * [Keep a Changelog](http://keepachangelog.com/) 48 | * [On Commit Messages](http://who-t.blogspot.de/2009/12/on-commit-messages.html) 49 | * [Semantic Versioning](http://semver.org/) 50 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Jam Risser (https://codejam.ninja) 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | CWD := $(shell pwd) 2 | TAG := latest 3 | PORT := 8080 4 | IMAGE := "codejamninja/make4docker:$(TAG)" 5 | SOME_CONTAINER := $(shell echo some-$(IMAGE) | sed 's/[^a-zA-Z0-9]//g') 6 | DOCKERFILE := $(CWD)/$(TAG)/Dockerfile 7 | 8 | .PHONY: all 9 | all: clean build 10 | 11 | .PHONY: build 12 | build: 13 | @docker build -t $(IMAGE) -f $(DOCKERFILE) $(CWD) 14 | @echo ::: BUILD ::: 15 | 16 | .PHONY: pull 17 | pull: 18 | @docker pull $(IMAGE) 19 | @echo ::: PULL ::: 20 | 21 | .PHONY: push 22 | push: 23 | @docker push $(IMAGE) 24 | @echo ::: PUSH ::: 25 | 26 | .PHONY: run 27 | run: 28 | @docker run --name run$(SOME_CONTAINER) -p $(PORT):$(PORT) --rm $(IMAGE) 29 | 30 | .PHONY: ssh 31 | ssh: 32 | @docker run --name ssh$(SOME_CONTAINER) --rm -it --entrypoint /bin/sh $(IMAGE) 33 | 34 | .PHONY: essh 35 | essh: 36 | @docker exec run$(SOME_CONTAINER) /bin/sh 37 | 38 | .PHONY: clean 39 | clean: 40 | -@ rm -rf ./stuff/to/clean &>/dev/null || true 41 | @echo ::: CLEAN ::: 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # make4docker 2 | 3 | [![GitHub stars](https://img.shields.io/github/stars/codejamninja/make4docker.svg?style=social&label=Stars)](https://github.com/codejamninja/make4docker) 4 | 5 | > Use GNU Make to simplify your Docker builds 6 | 7 | Please ★ this repo if you found it useful ★ ★ ★ 8 | 9 | ![](assets/make4docker.png) 10 | ## Features 11 | 12 | * Pull image 13 | * Build image 14 | * Push image 15 | * Run image 16 | * SSH into image 17 | * SSH into running container 18 | 19 | 20 | ## Installation 21 | 22 | ```sh 23 | curl -OL https://raw.githubusercontent.com/codejamninja/make4docker/master/Makefile 24 | ``` 25 | 26 | 27 | ## Dependencies 28 | 29 | * [GNU Make](https://www.gnu.org/software/make) 30 | * [Docker](https://www.docker.com) 31 | 32 | 33 | ## Usage 34 | 35 | | Command | Description | 36 | | ------------ | ---------------------------- | 37 | | `make` | cleans repo and builds image | 38 | | `make pull` | pulls image | 39 | | `make push` | push image | 40 | | `make build` | builds image | 41 | | `make run` | runs image | 42 | | `make ssh` | ssh into image | 43 | | `make essh` | ssh into running container | 44 | 45 | 46 | ## Support 47 | 48 | Submit an [issue](https://github.com/codejamninja/make4docker/issues/new) 49 | 50 | 51 | ## Contributing 52 | 53 | Review the [guidelines for contributing](https://github.com/codejamninja/make4docker/blob/master/CONTRIBUTING.md) 54 | 55 | 56 | ## License 57 | 58 | [MIT License](https://github.com/codejamninja/make4docker/blob/master/LICENSE) 59 | 60 | [Jam Risser](https://codejam.ninja) © 2018 61 | 62 | 63 | ## Changelog 64 | 65 | Review the [changelog](https://github.com/codejamninja/make4docker/blob/master/CHANGELOG.md) 66 | 67 | 68 | ## Credits 69 | 70 | * [Jam Risser](https://codejam.ninja) - Author 71 | 72 | 73 | ## Support on Liberapay 74 | 75 | A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project. 76 | 77 | [Add some fuel](https://liberapay.com/codejamninja/donate) if you'd like to keep me going! 78 | 79 | [![Liberapay receiving](https://img.shields.io/liberapay/receives/codejamninja.svg?style=flat-square)](https://liberapay.com/codejamninja/donate) 80 | [![Liberapay patrons](https://img.shields.io/liberapay/patrons/codejamninja.svg?style=flat-square)](https://liberapay.com/codejamninja/donate) 81 | -------------------------------------------------------------------------------- /assets/make4docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clayrisser/make4docker/3ae048539f2a003db29af63fc9b07451f7222c2e/assets/make4docker.png -------------------------------------------------------------------------------- /latest/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | 3 | LABEL image=codejamninja/erpnext:stable \ 4 | maintainer="Jam Risser " \ 5 | base=debian:stretch-slim 6 | 7 | WORKDIR /opt/app 8 | 9 | RUN apk add --no-cache tini 10 | 11 | ENTRYPOINT ["/sbin/tini", "--", "echo"] 12 | CMD ["hi"] 13 | --------------------------------------------------------------------------------