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

Initial makefile and minishift setup #2

Merged
merged 6 commits into from
Mar 22, 2019
Merged
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 <devtools@redhat.com>"
LABEL author "Devtools <devtools@redhat.com>"
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 <devtools@redhat.com>"
LABEL author "Devtools <devtools@redhat.com>"
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

LABEL maintainer "Devtools <devtools@redhat.com>"
LABEL author "Devtools <devtools@redhat.com>"
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"]
9 changes: 9 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true

[prune]
go-tests = true
unused-packages = true
Loading