Skip to content

Commit 4cd9265

Browse files
committed
Dockerfiles for migration
1 parent 01bb7e8 commit 4cd9265

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

migration-release.Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM alpine:3.20.3
2+
LABEL maintainer="[email protected]"
3+
ENV IN_DOCKER="Yes"
4+
5+
ARG USERNAME=sonar
6+
ARG USER_UID=1000
7+
ARG GROUPNAME=sonar
8+
9+
# Create the user
10+
RUN addgroup -S ${GROUPNAME} && adduser -u ${USER_UID} -S ${USERNAME} -G ${GROUPNAME}
11+
12+
# Install python/pip
13+
ENV PYTHONUNBUFFERED=1
14+
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
15+
16+
# create a virtual environment and add it to PATH so that it is
17+
# applied for all future RUN and CMD calls
18+
ENV VIRTUAL_ENV=/opt/venv
19+
RUN python3 -m venv ${VIRTUAL_ENV}
20+
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
21+
22+
WORKDIR /opt/sonar-migration
23+
24+
COPY ./sonar sonar
25+
COPY ./requirements.txt .
26+
COPY ./cli cli
27+
COPY ./setup_migration.py .
28+
COPY ./sonar_migration .
29+
COPY ./README.md .
30+
COPY ./LICENSE .
31+
COPY ./sonar/audit sonar/audit
32+
33+
RUN pip install --upgrade pip \
34+
&& pip install sonar-migration==0.1 --force-reinstall
35+
36+
USER ${USERNAME}
37+
WORKDIR /home/${USERNAME}
38+
39+
ENTRYPOINT ["sonar-migration"]

migration-snapshot.Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM alpine:3.20.3
2+
LABEL maintainer="[email protected]"
3+
ENV IN_DOCKER="Yes"
4+
5+
ARG USERNAME=sonar
6+
ARG USER_UID=1000
7+
ARG GROUPNAME=sonar
8+
9+
# Create the user
10+
RUN addgroup -S ${GROUPNAME} && adduser -u ${USER_UID} -S ${USERNAME} -G ${GROUPNAME}
11+
12+
# Install python/pip
13+
ENV PYTHONUNBUFFERED=1
14+
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
15+
16+
# create a virtual environment and add it to PATH so that it is
17+
# applied for all future RUN and CMD calls
18+
ENV VIRTUAL_ENV=/opt/venv
19+
RUN python3 -m venv ${VIRTUAL_ENV}
20+
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
21+
22+
WORKDIR /opt/sonar-migration
23+
24+
COPY ./sonar sonar
25+
COPY ./requirements.txt .
26+
COPY ./cli cli
27+
COPY ./setup_migration.py .
28+
COPY ./sonar_migration .
29+
COPY ./README.md .
30+
COPY ./LICENSE .
31+
COPY ./sonar/audit sonar/audit
32+
33+
RUN pip install --upgrade pip \
34+
&& pip install --no-cache-dir -r requirements.txt \
35+
&& pip install --no-cache-dir --upgrade pip setuptools wheel \
36+
&& python setup_migration.py bdist_wheel \
37+
&& pip install dist/sonar_migration-py3-*.whl --force-reinstall
38+
39+
USER ${USERNAME}
40+
WORKDIR /home/${USERNAME}
41+
42+
ENTRYPOINT ["sonar-migration"]

0 commit comments

Comments
 (0)