Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/newb2 #27

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1c01375
Initial jenkins pipe
Oct 18, 2021
39a9f09
pull code
Oct 18, 2021
5cb4afa
pull code
Oct 18, 2021
3d407de
Fix
Oct 18, 2021
261785b
fix
Oct 18, 2021
72a8a9a
fix
Oct 18, 2021
17bc143
fix
Oct 18, 2021
efd9e07
fix
Oct 18, 2021
d574c96
add stage
Oct 19, 2021
080816a
add buildname
Oct 19, 2021
be6bb1f
add buildname
Oct 19, 2021
a36d6ad
add buildname
Oct 19, 2021
54a6787
add buildname
Oct 19, 2021
f5f080d
add buildname
Oct 19, 2021
08ba0a6
add buildname
Oct 19, 2021
50b0ae5
add buildname
Oct 19, 2021
97ac90b
add buildname
Oct 19, 2021
7248cbe
add buildname
Oct 19, 2021
b1cde1a
add buildname
Oct 19, 2021
4eaa591
fix
Oct 19, 2021
1b446b1
fix
Oct 19, 2021
5b229df
fix
Oct 20, 2021
9bce713
fix
Oct 20, 2021
898901e
fix
Oct 20, 2021
0268820
fix
Oct 20, 2021
1702e6c
fix
Oct 20, 2021
e88b95e
fix
Oct 20, 2021
0f478c7
fix
Oct 21, 2021
7bb2384
fix
Oct 21, 2021
a64a1d3
Update Jenkinsfile
h34dl355 Oct 27, 2021
f66960c
fix version
Jan 10, 2022
8ae65fd
Update Jenkinsfile
h34dl355 Oct 25, 2022
023c10f
Update Jenkinsfile
h34dl355 Oct 25, 2022
38f9289
Update Jenkinsfile
h34dl355 Oct 25, 2022
3eca46c
New Jenkinsfile
Dec 11, 2022
f72342f
New Jenkinsfile
Dec 11, 2022
47e4893
New Jenkinsfile
Dec 11, 2022
b0aa714
New Jenkinsfile
Dec 11, 2022
1023502
New Jenkinsfile
Dec 11, 2022
85b3a6e
New Jenkinsfile
Dec 11, 2022
8dc8abd
New Jenkinsfile
Dec 11, 2022
92e8839
New Jenkinsfile
Dec 11, 2022
014a803
fix dockerfile
Dec 11, 2022
19f5531
Create Dockerfile2
h34dl355 Apr 7, 2023
0f6f3da
new pipe
Apr 10, 2023
95708b9
new pipe
Apr 10, 2023
1452c11
new
Apr 10, 2023
88d66eb
new
Apr 10, 2023
f88dc01
fix
Apr 24, 2023
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
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM golang:1.16-alpine as builder
WORKDIR /build
COPY . .
#RUN go mod download
RUN go build -o /example ./main.go
FROM alpine:3
WORKDIR /app
COPY --from=builder /example /app/example
ENTRYPOINT ["/app/example"]
172 changes: 172 additions & 0 deletions Dockerfile2
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# syntax=docker/dockerfile:1

ARG BASE_IMAGE=alpine:3.17
ARG JS_IMAGE=node:18-alpine3.17
ARG JS_PLATFORM=linux/amd64
ARG GO_IMAGE=golang:1.20.1-alpine3.17

ARG GO_SRC=go-builder
ARG JS_SRC=js-builder

FROM --platform=${JS_PLATFORM} ${JS_IMAGE} as js-builder

ENV NODE_OPTIONS=--max_old_space_size=8000

WORKDIR /tmp/grafana

COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn .yarn
COPY packages packages
COPY plugins-bundled plugins-bundled

RUN yarn install --immutable

COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js babel.config.json .linguirc ./
COPY public public
COPY scripts scripts
COPY emails emails

ENV NODE_ENV production
RUN yarn build

FROM ${GO_IMAGE} as go-builder

ARG GO_BUILD_TAGS="oss"
ARG WIRE_TAGS="oss"
ARG BINGO="true"

# Install build dependencies
RUN if grep -i -q alpine /etc/issue; then \
apk add --no-cache gcc g++ make git; \
fi

WORKDIR /tmp/grafana

COPY go.* ./
COPY .bingo .bingo

RUN go mod download
RUN if [[ "$BINGO" = "true" ]]; then \
go install github.com/bwplotka/bingo@latest && \
bingo get -v; \
fi

COPY embed.go Makefile build.go package.json ./
COPY cue.mod cue.mod
COPY kinds kinds
COPY local local
COPY packages/grafana-schema packages/grafana-schema
COPY public/app/plugins public/app/plugins
COPY public/api-merged.json public/api-merged.json
COPY pkg pkg
COPY scripts scripts
COPY conf conf
COPY .github .github
COPY .git .git

RUN make build-go GO_BUILD_TAGS=${GO_BUILD_TAGS} WIRE_TAGS=${WIRE_TAGS}

FROM ${BASE_IMAGE} as tgz-builder

WORKDIR /tmp/grafana

ARG GRAFANA_TGZ="grafana-latest.linux-x64-musl.tar.gz"

COPY ${GRAFANA_TGZ} /tmp/grafana.tar.gz

# add -v to make tar print every file it extracts
RUN tar x -z -f /tmp/grafana.tar.gz --strip-components=1

# helpers for COPY --from
FROM ${GO_SRC} as go-src
FROM ${JS_SRC} as js-src

# Final stage
FROM ${BASE_IMAGE}

LABEL maintainer="Grafana Labs <[email protected]>"

ARG GF_UID="472"
ARG GF_GID="0"

ENV PATH="/usr/share/grafana/bin:$PATH" \
GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \
GF_PATHS_DATA="/var/lib/grafana" \
GF_PATHS_HOME="/usr/share/grafana" \
GF_PATHS_LOGS="/var/log/grafana" \
GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \
GF_PATHS_PROVISIONING="/etc/grafana/provisioning"

WORKDIR $GF_PATHS_HOME

# Install dependencies
RUN if grep -i -q alpine /etc/issue; then \
apk add --no-cache ca-certificates bash curl tzdata musl-utils && \
apk info -vv | sort; \
elif grep -i -q ubuntu /etc/issue; then \
DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y ca-certificates curl tzdata && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*; \
else \
echo 'ERROR: Unsupported base image' && /bin/false; \
fi

# glibc support for alpine x86_64 only
RUN if grep -i -q alpine /etc/issue && [ `arch` = "x86_64" ]; then \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk \
-O /tmp/glibc-2.35-r0.apk && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-bin-2.35-r0.apk \
-O /tmp/glibc-bin-2.35-r0.apk && \
apk add --force-overwrite --no-cache /tmp/glibc-2.35-r0.apk /tmp/glibc-bin-2.35-r0.apk && \
rm -f /lib64/ld-linux-x86-64.so.2 && \
ln -s /usr/glibc-compat/lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 && \
rm -f /tmp/glibc-2.35-r0.apk && \
rm -f /tmp/glibc-bin-2.35-r0.apk && \
rm -f /lib/ld-linux-x86-64.so.2 && \
rm -f /etc/ld.so.cache; \
fi

COPY --from=go-src /tmp/grafana/conf ./conf

RUN if [ ! $(getent group "$GF_GID") ]; then \
if grep -i -q alpine /etc/issue; then \
addgroup -S -g $GF_GID grafana; \
else \
addgroup --system --gid $GF_GID grafana; \
fi; \
fi && \
GF_GID_NAME=$(getent group $GF_GID | cut -d':' -f1) && \
mkdir -p "$GF_PATHS_HOME/.aws" && \
if grep -i -q alpine /etc/issue; then \
adduser -S -u $GF_UID -G "$GF_GID_NAME" grafana; \
else \
adduser --system --uid $GF_UID --ingroup "$GF_GID_NAME" grafana; \
fi && \
mkdir -p "$GF_PATHS_PROVISIONING/datasources" \
"$GF_PATHS_PROVISIONING/dashboards" \
"$GF_PATHS_PROVISIONING/notifiers" \
"$GF_PATHS_PROVISIONING/plugins" \
"$GF_PATHS_PROVISIONING/access-control" \
"$GF_PATHS_PROVISIONING/alerting" \
"$GF_PATHS_LOGS" \
"$GF_PATHS_PLUGINS" \
"$GF_PATHS_DATA" && \
cp conf/sample.ini "$GF_PATHS_CONFIG" && \
cp conf/ldap.toml /etc/grafana/ldap.toml && \
chown -R "grafana:$GF_GID_NAME" "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"

COPY --from=go-src /tmp/grafana/bin/grafana* /tmp/grafana/bin/*/grafana* ./bin/
COPY --from=js-src /tmp/grafana/public ./public

EXPOSE 3000

ARG RUN_SH=./packaging/docker/run.sh

COPY ${RUN_SH} /run.sh

USER "$GF_UID"
ENTRYPOINT [ "/run.sh" ]
5 changes: 5 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@Library('shared-pipeline@feature/test') _



testpipe()
202 changes: 0 additions & 202 deletions LICENSE

This file was deleted.

Loading