-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap official Grafeas image build (#1)
* Update Dockerfile * Create docker-compose.test.yml * Create Dockerfile for linting * Update README.md * Delete build.sh * Update config.yaml.toml * Update entrypoint.sh * Update docker-compose.test.yml
- Loading branch information
Showing
7 changed files
with
33 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
FROM golang:1.10.3 | ||
COPY . /go/src/github.com/grafeas/grafeas/ | ||
WORKDIR /go/src/github.com/grafeas/grafeas/samples/server/go-server/api/server/main | ||
RUN CGO_ENABLED=0 go build -o grafeas-server . | ||
ARG GRAFEAS_VERSION=0.1.0 | ||
FROM us.gcr.io/grafeas/grafeas-server:${GRAFEAS_VERSION} as grafeas-official | ||
|
||
FROM alpine:latest as confd | ||
ARG CONFD_VERSION=0.15.0 | ||
ADD https://github.com/kelseyhightower/confd/releases/download/v${CONFD_VERSION}/confd-${CONFD_VERSION}-linux-amd64 /usr/local/bin/confd | ||
RUN chmod +x /usr/local/bin/confd | ||
|
||
FROM alpine:latest | ||
WORKDIR / | ||
ADD https://github.com/kelseyhightower/confd/releases/download/v0.15.0/confd-0.15.0-linux-amd64 /usr/local/bin/confd | ||
COPY build-files /tmp | ||
WORKDIR /grafeas | ||
RUN USER=grafeas && \ | ||
UID=1234 && \ | ||
GID=5678 && \ | ||
addgroup -g "$GID" -S "$USER" && \ | ||
adduser --disabled-password \ | ||
-u "$UID" -S "$USER" -G "$USER" && \ | ||
chown -R grafeas:grafeas /grafeas | ||
COPY --chown=grafeas:grafeas --from=confd /usr/local/bin/confd /usr/local/bin/confd | ||
COPY --chown=grafeas:grafeas --from=grafeas-official /grafeas-server . | ||
COPY --chown=grafeas:grafeas build-files /tmp | ||
RUN chmod +x /usr/local/bin/confd && \ | ||
mv /tmp/confd /etc && \ | ||
mv /tmp/entrypoint.sh /entrypoint.sh && \ | ||
chmod +x /entrypoint.sh | ||
COPY --from=0 /go/src/github.com/grafeas/grafeas/samples/server/go-server/api/server/main/grafeas-server /grafeas-server | ||
mv /tmp/entrypoint.sh /grafeas/entrypoint.sh && \ | ||
chmod +x /grafeas/entrypoint.sh | ||
USER grafeas | ||
EXPOSE 8080 | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["-config", "config.yaml"] | ||
ENTRYPOINT ["/grafeas/entrypoint.sh"] | ||
CMD ["-config", "config.yaml"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ fi | |
|
||
/usr/local/bin/confd -onetime -backend "${CONFD_BACKEND}" | ||
|
||
exec /grafeas-server "$@" | ||
exec ./grafeas-server "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sut: | ||
dockerfile: test/Dockerfile | ||
build: . | ||
command: hadolint --ignore DL3007 - Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ARG HADOLINT_VERSION=latest | ||
FROM hadolint/hadolint:${HADOLINT_VERSION} | ||
COPY Dockerfile . |