-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: vankichi <[email protected]>
- Loading branch information
Showing
7 changed files
with
251 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# | ||
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# You may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# DO_NOT_EDIT this workflow file is generated by https://github.com/vdaas/vald/blob/main/hack/actions/gen/main.go | ||
|
||
name: "Build docker image: example-client" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- release/v*.* | ||
- "!release/v*.*.*" | ||
tags: | ||
- "*.*.*" | ||
- v*.*.* | ||
- "*.*.*-*" | ||
- v*.*.*-* | ||
pull_request: | ||
paths: | ||
- hack/docker/gen/main.go | ||
- dockers/example/client/Dockerfile | ||
- hack/actions/gen/main.go | ||
- .github/workflows/dockers-example-client-image.yaml | ||
- .github/actions/docker-build/action.yaml | ||
- .github/workflows/_docker-image.yaml | ||
- example/client/** | ||
- apis/grpc/** | ||
- apis/proto/** | ||
- go.mod | ||
- go.sum | ||
- versions/GO_VERSION | ||
- internal/** | ||
- "!internal/**/*_test.go" | ||
- "!internal/**/*_mock.go" | ||
- "!internal/db/**" | ||
- Makefile | ||
- Makefile.d/** | ||
pull_request_target: | ||
paths: | ||
- hack/docker/gen/main.go | ||
- dockers/example/client/Dockerfile | ||
- hack/actions/gen/main.go | ||
- .github/workflows/dockers-example-client-image.yaml | ||
- .github/actions/docker-build/action.yaml | ||
- .github/workflows/_docker-image.yaml | ||
- example/client/** | ||
- apis/grpc/** | ||
- apis/proto/** | ||
- go.mod | ||
- go.sum | ||
- versions/GO_VERSION | ||
- internal/** | ||
- "!internal/**/*_test.go" | ||
- "!internal/**/*_mock.go" | ||
- "!internal/db/**" | ||
- Makefile | ||
- Makefile.d/** | ||
jobs: | ||
build: | ||
uses: ./.github/workflows/_docker-image.yaml | ||
with: | ||
target: example-client | ||
secrets: inherit |
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
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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# syntax = docker/dockerfile:latest | ||
# | ||
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# You may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go | ||
ARG UPX_OPTIONS=-9 | ||
# skipcq: DOK-DL3026,DOK-DL3007 | ||
FROM ghcr.io/vdaas/vald/vald-buildbase:nightly AS builder | ||
LABEL maintainer="vdaas.org vald team <[email protected]>" | ||
# skipcq: DOK-DL3002 | ||
USER root:root | ||
ARG TARGETARCH | ||
ARG TARGETOS | ||
ARG GO_VERSION | ||
ARG RUST_VERSION | ||
ENV APP_NAME=client | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV GO111MODULE=on | ||
ENV GOPATH=/go | ||
ENV GOROOT=/opt/go | ||
ENV HOME=/root | ||
ENV INITRD=No | ||
ENV LANG=en_US.UTF-8 | ||
ENV LANGUAGE=en_US.UTF-8 | ||
ENV LC_ALL=en_US.UTF-8 | ||
ENV ORG=vdaas | ||
ENV PKG=example/client | ||
ENV REPO=vald | ||
ENV TZ=Etc/UTC | ||
ENV USER=root | ||
ENV PATH=${GOPATH}/bin:${GOROOT}/bin:/usr/local/bin:${PATH} | ||
WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO} | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
#skipcq: DOK-W1001, DOK-SC2046, DOK-SC2086, DOK-DL3008 | ||
RUN --mount=type=bind,target=.,rw \ | ||
--mount=type=tmpfs,target=/tmp \ | ||
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=${APP_NAME} \ | ||
--mount=type=cache,target=/var/cache/apt,sharing=locked,id=${APP_NAME} \ | ||
--mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ | ||
--mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ | ||
--mount=type=tmpfs,target="${GOPATH}/src" \ | ||
set -ex \ | ||
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \ | ||
&& echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/no-install-recommends \ | ||
&& apt-get clean \ | ||
&& apt-get update -y \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y --no-install-recommends --fix-missing \ | ||
build-essential \ | ||
ca-certificates \ | ||
curl \ | ||
tzdata \ | ||
locales \ | ||
git \ | ||
cmake \ | ||
g++ \ | ||
gcc \ | ||
libssl-dev \ | ||
unzip \ | ||
libhdf5-dev \ | ||
libaec-dev \ | ||
&& ldconfig \ | ||
&& echo "${LANG} UTF-8" > /etc/locale.gen \ | ||
&& ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \ | ||
&& locale-gen ${LANGUAGE} \ | ||
&& update-locale LANG=${LANGUAGE} \ | ||
&& dpkg-reconfigure -f noninteractive tzdata \ | ||
&& apt-get clean \ | ||
&& apt-get autoclean -y \ | ||
&& apt-get autoremove -y \ | ||
&& make GOPATH="${GOPATH}" GOROOT="${GOROOT}" GO_VERSION="${GO_VERSION}" go/install \ | ||
&& make GOPATH="${GOPATH}" GOROOT="${GOROOT}" GO_VERSION="${GO_VERSION}" go/download \ | ||
&& make hdf5/install \ | ||
&& make GOARCH="${TARGETARCH}" GOOS="${TARGETOS}" REPO="${ORG}" NAME="${REPO}" ${PKG}/${APP_NAME} \ | ||
&& mv "${PKG}/${APP_NAME}" "/usr/bin/${APP_NAME}" | ||
# skipcq: DOK-DL3026,DOK-DL3007 | ||
FROM gcr.io/distroless/static:nonroot | ||
LABEL maintainer="vdaas.org vald team <[email protected]>" | ||
COPY --from=builder /usr/bin/client /usr/bin/client | ||
# skipcq: DOK-DL3002 | ||
USER nonroot:nonroot | ||
ENTRYPOINT ["/usr/bin/client"] |
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