Skip to content

Commit b0e74be

Browse files
authored
Merge pull request #5 from gremlin/docker-image-fix
cleaned up unwanted docker crud
2 parents 7bc4b55 + 521733b commit b0e74be

7 files changed

Lines changed: 14 additions & 47 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ venv/
109109
ENV/
110110
env.bak/
111111
venv.bak/
112+
env.vars
112113

113114
# Spyder project settings
114115
.spyderproject

Dockerfile

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
FROM alpine:latest
22
LABEL maintainer="kyle@gremlin.com"
33

4-
54
# Runtime arguments
65
ARG BUILD_DATE
76
ARG IMAGE_NAME
8-
ARG KUBECTL_VERSION="v1.16.1"
9-
ARG KUBECTL_DOWNLOAD="https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"
10-
ARG HELM_DOWNLOAD="https://raw.githubusercontent.com/helm/helm/master/scripts/get"
11-
ARG EKSCTL_DOWNLOAD="https://github.com/weaveworks/eksctl/releases/download/latest_release/eksctl_Linux_amd64.tar.gz"
127
ARG AWS_IAMAUTH_DOWNLOAD="https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/linux/amd64/aws-iam-authenticator"
8+
ARG GREMLIN_PYTHON_REPO="https://github.com/gremlin/gremlin-python.git"
139

1410
# Container Labels
1511
LABEL org.label-schema.schema-version="1.0"
@@ -27,21 +23,19 @@ RUN python3 -m ensurepip && \
2723
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \
2824
rm -r /root/.cache
2925

30-
RUN pip --no-cache-dir install --upgrade awscli bitly_api boto3 datadog jinja2 kubernetes==9.0.1
26+
RUN pip --no-cache-dir install --upgrade awscli boto3
3127

32-
RUN curl $HELM_DOWNLOAD | bash
28+
RUN curl -s -L $AWS_IAMAUTH_DOWNLOAD -o /usr/local/bin/aws-iam-authenticator && chmod 755 /usr/local/bin/aws-iam-authenticator
3329

34-
RUN curl --silent --location $EKSCTL_DOWNLOAD | tar xz -C /usr/local/bin && chmod 755 /usr/local/bin/eksctl
30+
RUN mkdir -p /opt/gremlin-python
3531

36-
RUN curl -s -L $AWS_IAMAUTH_DOWNLOAD -o /usr/local/bin/aws-iam-authenticator && chmod 755 /usr/local/bin/aws-iam-authenticator
32+
WORKDIR /opt/gremlin-python
3733

38-
RUN echo $KUBECTL_DOWNLOAD
39-
RUN curl -s -L $KUBECTL_DOWNLOAD -o /usr/bin/kubectl && chmod 755 /usr/bin/kubectl
34+
# RUN git clone $GREMLIN_PYTHON_REPO .
35+
COPY . .
4036

41-
RUN mkdir -p /opt/gremlin-python
42-
#ADD src /opt/bootcamp
43-
#
44-
#RUN chmod 755 /opt/bootcamp/bootcamp.py
37+
# uncomment to install the package container wide
38+
# RUN python3 setup.py install
4539

46-
ENTRYPOINT ["python3", "/opt/bootcamp/bootcamp.py", "-x"]
47-
CMD ["make build"]
40+
ENTRYPOINT ["/bin/ash"]
41+
CMD ["/bin/ash"]

Makefile

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,17 @@ DOCKER_OWNER=gremlin
22
DOCKER_NAME=gremlin-python-api
33
DOCKER_IMAGE=$(DOCKER_OWNER)/$(DOCKER_NAME)
44

5-
MAJOR_VERSION_FILE=docker-build-major-version.txt
6-
MINOR_VERSION_FILE=docker-build-minor-version.txt
7-
BUILD_VERSION_FILE=docker-build-version.txt
8-
BUILD_VERSION=$(shell cat $(MAJOR_VERSION_FILE)).$(shell cat $(MINOR_VERSION_FILE))
95
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
10-
11-
KUBECTL_VERSION=$(shell curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
12-
136
ENV_VARS=env.vars
147

15-
all: docker-build #docker-push
8+
all: docker-build
169

17-
docker-build: $(MINOR_VERSION_FILE)
18-
BUILD_VERSION=$(shell cat $(MAJOR_VERSION_FILE)).$(shell cat $(MINOR_VERSION_FILE))
10+
docker-build:
1911
docker build --no-cache=true \
2012
--build-arg BUILD_DATE=$(BUILD_DATE) \
2113
--build-arg IMAGE_NAME=$(DOCKER_IMAGE) \
22-
--build-arg KUBECTL_VERSION=$(KUBECTL_VERSION) \
23-
-t $(DOCKER_IMAGE):$(BUILD_VERSION) \
2414
-t $(DOCKER_IMAGE):latest \
2515
.
26-
echo ${BUILD_VERSION} > $(BUILD_VERSION_FILE)
27-
28-
docker-push:
29-
docker push $(DOCKER_IMAGE):$(BUILD_VERSION)
30-
docker push $(DOCKER_IMAGE):latest
3116

3217
docker-run:
3318
@if ! test -f $(ENV_VARS); then touch $(ENV_VARS); fi
@@ -38,13 +23,3 @@ docker-run-interactive:
3823
@if ! test -f $(ENV_VARS); then touch $(ENV_VARS); fi
3924
docker run -it --rm -v ~/.ssh/:/root/.ssh --mount type=bind,source="$(PWD)",target=/opt/gremlin-python \
4025
--env-file=env.vars --name $(DOCKER_NAME) --entrypoint "/bin/ash" $(DOCKER_IMAGE):latest
41-
42-
$(MAJOR_VERSION_FILE):
43-
@if ! test -f $(MAJOR_VERSION_FILE); then echo 0 > $(MAJOR_VERSION_FILE); fi
44-
@echo $$(($$(shell cat $(MAJOR_VERSION_FILE)) + 1)) > $(MAJOR_VERSION_FILE)
45-
@echo $$(($$(shell cat $(MAJOR_VERSION_FILE)).$(shell cat $(MINOR_VERSION_FILE)))) > $(BUILD_VERSION_FILE)
46-
47-
$(MINOR_VERSION_FILE):
48-
@if ! test -f $(MINOR_VERSION_FILE); then echo 0 > $(MINOR_VERSION_FILE); fi
49-
@echo $$(($$(shell cat $(MINOR_VERSION_FILE)) + 1)) > $(MINOR_VERSION_FILE)
50-
@echo $$(($$(shell cat $(MAJOR_VERSION_FILE)).$(shell cat $(MINOR_VERSION_FILE)))) > $(BUILD_VERSION_FILE)

docker-build-major-version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

docker-build-minor-version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

docker-build-version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

env.vars

Whitespace-only changes.

0 commit comments

Comments
 (0)