Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Base Image updated to python:2.7.15-alpine3.8 (#23)
Browse files Browse the repository at this point in the history
* Base Image is based on python:2.7.15-alpine3.8

* COPY kubectl to Docker Image

* clean up old Dockerfile
  • Loading branch information
vgunapati authored and shrinandj committed Feb 20, 2019
1 parent ad69c2a commit f5691ec
Show file tree
Hide file tree
Showing 5 changed files with 834 additions and 16 deletions.
24 changes: 20 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
FROM shrinand/k8s-minion-manager:v0.1
FROM python:2.7.15-alpine3.8 AS Base

COPY . /
ENV PYTHONPATH=/
RUN mv binaries/kubectl-v1.12.3-linux-amd64 /usr/local/bin/kubectl
RUN pip install pipenv==2018.10.13
WORKDIR /src
COPY Pipfile /src/
COPY Pipfile.lock /src/
COPY binaries/kubectl-v1.12.3-linux-amd64 /usr/local/bin/kubectl

# This will be used as Main Image
FROM Base AS Main

RUN pipenv install --system --deploy
COPY . /src
ENV PYTHONPATH=/src
RUN chmod u+x minion_manager.py


FROM Base AS Dev

RUN apk add --no-cache build-base openssl-dev libffi-dev
RUN pipenv install --system --deploy --dev
#COPY . /src
10 changes: 0 additions & 10 deletions Dockerfile.test

This file was deleted.

7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
TEST_PATH=./
BUILD=docker build --target
RUN=docker run --rm -it
VERSION=v0.7-dev
GIT_TAG=$(shell git rev-parse --short HEAD)

Expand Down Expand Up @@ -31,10 +33,11 @@ test: clean
pytest --junitxml=${TEST_PATH}/pytest-results.xml -s --color=yes $(TEST_PATH)

docker-test: clean
docker run -v ${PWD}:/src -v ~/.aws:/root/.aws shrinand/k8s-minion-manager-test:v0.1 make test
$(BUILD) dev -t $(IMAGE_PREFIX)k8s-minion-manager-test:$(IMAGE_TAG) .
$(RUN) -v ${PWD}:/src -v ~/.aws:/root/.aws $(IMAGE_PREFIX)k8s-minion-manager-test:$(IMAGE_TAG) make test

docker: clean
docker build -t $(IMAGE_PREFIX)k8s-minion-manager:$(IMAGE_TAG) .
$(BUILD) main -t $(IMAGE_PREFIX)k8s-minion-manager:$(IMAGE_TAG) .
docker tag $(IMAGE_PREFIX)k8s-minion-manager:$(IMAGE_TAG) $(IMAGE_PREFIX)k8s-minion-manager:${VERSION}
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)k8s-minion-manager:$(IMAGE_TAG) ; fi

Expand Down
21 changes: 21 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
boto3 = "==1.7.84"
retrying = "==1.3.3"
bunch = "==1.0.1"
Flask = "==0.12"
pytz = "==2016.10"
requests = "==2.13.0"
kubernetes = "==2.0.0"

[dev-packages]
pytest = "==3.9.3"
mock = "==2.0.0"
moto = "==1.3.6"

[requires]
python_version = "2.7.15"
Loading

0 comments on commit f5691ec

Please sign in to comment.