Skip to content
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
4 changes: 2 additions & 2 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@ System properties to configure HBase test executions:
| Property | Description | Default value |
| -------- | ----------- | ------------- |
| `hbase.docker.version` | HBase version to be used in the docker image. | `2.6.0` |
| `hbase.docker.uid` | Uid used to run inside HBase of the container | 1000 |
| `hbase.docker.gid` | Gid used to run inside HBase of the container | 1000 |
| `hbase.docker.uid` | Uid used to run inside HBase of the container | 999 |
| `hbase.docker.gid` | Gid used to run inside HBase of the container | 999 |
2 changes: 1 addition & 1 deletion janusgraph-dist/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

ARG BASE_IMAGE=eclipse-temurin:11-jre

FROM debian:bullseye-slim as builder
FROM debian:bullseye-slim AS builder

ARG TARGETARCH
ARG JANUS_VERSION=1.0.0-SNAPSHOT
Expand Down
32 changes: 13 additions & 19 deletions janusgraph-hbase/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM debian:bookworm-20240211 as builder
FROM debian:bookworm-20240211 AS builder

ARG HBASE_VERSION=2.6.0
ARG HBASE_DIST="https://archive.apache.org/dist/hbase"
Expand All @@ -27,33 +27,27 @@
COPY ./hbase-site.xml /opt/hbase/conf/hbase-site.xml
COPY ./hbase-policy.xml /opt/hbase/conf/hbase-policy.xml

FROM openjdk:8-jre-bullseye
FROM eclipse-temurin:8-jre

ARG HBASE_UID=1000
ARG HBASE_GID=1000
ARG HBASE_UID=999
ARG HBASE_GID=999

ENV LOGS_DIR=/data/logs

COPY --from=builder /opt/hbase/ /opt/hbase/

RUN ln -sf /opt/hbase/bin/* /usr/bin/
RUN mkdir -p $LOGS_DIR /data/hbase /data/wal /data/run /opt/hbase/logs
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y socat
WORKDIR /opt/hbase
COPY ./entrypoint.sh /entrypoint.sh

EXPOSE 2181
EXPOSE 16000
EXPOSE 16010
EXPOSE 16020
EXPOSE 16030
RUN ln -sf /opt/hbase/bin/* /usr/bin/ \

Check warning on line 42 in janusgraph-hbase/docker/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

janusgraph-hbase/docker/Dockerfile#L42

Avoid additional packages by specifying `--no-install-recommends`

Check warning on line 42 in janusgraph-hbase/docker/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

janusgraph-hbase/docker/Dockerfile#L42

Delete the apt-get lists after installing something

Check warning on line 42 in janusgraph-hbase/docker/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

janusgraph-hbase/docker/Dockerfile#L42

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
&& mkdir -p $LOGS_DIR /data/hbase /data/wal /data/run /opt/hbase/logs \
&& apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y socat \
&& groupadd -g ${HBASE_GID} hbase \
&& useradd -s /bin/bash hbase -u ${HBASE_UID} -g ${HBASE_GID} \
&& chmod +x /entrypoint.sh \
&& chown -R ${HBASE_UID}:${HBASE_GID} /data /opt/hbase/logs

ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 2181 16000 16010 16020 16030

RUN groupadd -g ${HBASE_GID} hbase && \
useradd -s /bin/bash hbase -u ${HBASE_UID} -g ${HBASE_GID} && \
chmod +x /entrypoint.sh && \
chown -R ${HBASE_UID}:${HBASE_GID} /data && \
chown -R ${HBASE_UID}:${HBASE_GID} /opt/hbase/logs
USER hbase
ENTRYPOINT ["/entrypoint.sh"]
4 changes: 2 additions & 2 deletions janusgraph-hbase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

<properties>
<hadoop.profile>2.0</hadoop.profile>
<hbase.docker.uid>1000</hbase.docker.uid>
<hbase.docker.gid>1000</hbase.docker.gid>
<hbase.docker.uid>999</hbase.docker.uid>
<hbase.docker.gid>999</hbase.docker.gid>
<top.level.basedir>${basedir}/..</top.level.basedir>
<test.hbase.targetdir>${basedir}/target</test.hbase.targetdir>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class HBaseContainer extends GenericContainer<HBaseContainer> {
public static final String HBASE_TARGET_DIR = "test.hbase.targetdir";
public static final String HBASE_DOCKER_PATH = "janusgraph-hbase/docker";
private static final String DEFAULT_VERSION = "2.6.0";
private static final String DEFAULT_UID = "1000";
private static final String DEFAULT_GID = "1000";
private static final String DEFAULT_UID = "999";
private static final String DEFAULT_GID = "999";

private static String getVersion() {
String property = System.getProperty("hbase.docker.version");
Expand Down
Loading