Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

WIP Initial api server #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

/vendor
/.idea
/bin
/tmp
37 changes: 37 additions & 0 deletions Dockerfile.builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM centos:7
LABEL maintainer "Devtools <[email protected]>"
LABEL author "Devtools <[email protected]>"
ENV LANG=en_US.utf8
ARG USE_GO_VERSION_FROM_WEBSITE=0

# Some packages might seem weird but they are required by the RVM installer.
RUN yum install epel-release -y \
&& yum --enablerepo=centosplus --enablerepo=epel install -y \
findutils \
git \
$(test "$USE_GO_VERSION_FROM_WEBSITE" != 1 && echo "golang") \
make \
procps-ng \
tar \
wget \
which \
&& yum clean all

RUN if [[ "$USE_GO_VERSION_FROM_WEBSITE" = 1 ]]; then cd /tmp \
&& wget https://dl.google.com/go/go1.10.linux-amd64.tar.gz \
&& echo "b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33 go1.10.linux-amd64.tar.gz" > checksum \
&& sha256sum -c checksum \
&& tar -C /usr/local -xzf go1.10.linux-amd64.tar.gz \
&& rm -f go1.10.linux-amd64.tar.gz; \
fi
ENV PATH=$PATH:/usr/local/go/bin

# Get dep for Go package management and make sure the directory has full rwz permissions for non-root users
ENV GOPATH /tmp/go
RUN mkdir -p $GOPATH/bin && chmod a+rwx $GOPATH
RUN cd $GOPATH/bin \
curl -L -s https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 -o dep \
echo "287b08291e14f1fae8ba44374b26a2b12eb941af3497ed0ca649253e21ba2f83 dep" > dep-linux-amd64.sha256 \
sha256sum -c dep-linux-amd64.sha256

ENTRYPOINT ["/bin/bash"]
18 changes: 18 additions & 0 deletions Dockerfile.deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM centos:7
LABEL maintainer "Devtools <[email protected]>"
LABEL author "Devtools <[email protected]>"
ENV LANG=en_US.utf8
ENV INSTALL_PREFIX=/usr/local/git-service

# Create a non-root user and a group with the same name: "devconsole-operator"
ENV USER_NAME=devconsole-operator
RUN useradd --no-create-home -s /bin/bash ${USER_NAME}

COPY bin/git-service ${INSTALL_PREFIX}/bin/git-service

# From here onwards, any RUN, CMD, or ENTRYPOINT will be run under the following user
USER ${USER_NAME}

WORKDIR ${INSTALL_PREFIX}

ENTRYPOINT [ "bin/git-service" ]
19 changes: 19 additions & 0 deletions Dockerfile.deploy.rhel
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM quay.io/openshiftio/rhel-base-golang:latest

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should start using multi-stage docker build https://docs.docker.com/develop/develop-images/multistage-build/

Copy link

@xcoulon xcoulon Mar 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dipak-pawar it was not supported in OpenShift 3 because the version of the supported Docker daemon was too old. I'm not sure about OpenShift 4, though. Maybe it could work with Buildah ?


LABEL maintainer "Devtools <[email protected]>"
LABEL author "Devtools <[email protected]>"
ENV LANG=en_US.utf8
ENV INSTALL_PREFIX=/usr/local/git-service

# Create a non-root user and a group with the same name: "devconsole-operator"
ENV USER_NAME=devconsole-operator
RUN useradd --no-create-home -s /bin/bash ${USER_NAME}

COPY bin/git-service ${INSTALL_PREFIX}/bin/git-service

# From here onwards, any RUN, CMD, or ENTRYPOINT will be run under the following user
USER ${USER_NAME}

WORKDIR ${INSTALL_PREFIX}

ENTRYPOINT [ "bin/git-service" ]
6 changes: 6 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM centos:7

RUN mkdir -p /tmp/
ADD bin/git-service /

ENTRYPOINT ["/git-service"]
Loading