Skip to content

Commit

Permalink
feat: add docker run commands for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinying committed Jul 13, 2024
1 parent 5f03a7f commit 074d51e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
PROJECT_NAME ?= modpoll

.PHONY: install
install: ## Install the poetry environment and install the pre-commit hooks
@echo "πŸš€ Creating virtual environment using pyenv and poetry"
Expand Down Expand Up @@ -45,16 +47,23 @@ publish: ## Publish a release to PyPI.
.PHONY: build-and-publish
build-and-publish: build publish ## Build and publish.

.PHONY: docker-dev
docker-dev: ## Build docker using docker buildx
.PHONY: docker-build-dev
docker-build-dev: ## Build docker using docker buildx
@echo "πŸš€ Login to docker registry"
@echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin "${DOCKER_REGISTRY}"
@echo "πŸš€ Set up QEMU"
@docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
@echo "πŸš€ Create the builder if not exists"
@docker buildx inspect mybuilder &>/dev/null || docker buildx create --name mybuilder ; docker buildx use mybuilder
@echo "πŸš€ Creating docker image file"
@docker buildx build --platform linux/amd64,linux/arm64 -t ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/modpoll:dev --push .
@docker buildx build --platform linux/amd64,linux/arm64 -t ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${PROJECT_NAME}:dev --push .

.PHONY: docker-run-dev
docker-run-dev: docker-build-dev ## run in docker
@echo "πŸš€ Docker run: ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${PROJECT_NAME}:dev"
@docker run --rm ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${PROJECT_NAME}:dev \
modpoll -1 --tcp modsim.topmaker.net \
-f https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv

.PHONY: docs
docs: ## Build docs into html files
Expand Down

0 comments on commit 074d51e

Please sign in to comment.