Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Iliya Savov <[email protected]>
  • Loading branch information
isavov committed Jan 15, 2024
1 parent 97b4a2c commit 012062a
Showing 1 changed file with 59 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV DEBIAN_FRONTEND=noninteractive

# Install basic OS utilities for building
RUN apt-get update && \
apt-get install --yes tar gzip gnupg2 curl
apt-get install --yes tar gzip gnupg2 curl

##########################
#### Java Setup ####
Expand All @@ -33,33 +33,33 @@ RUN apt-get update && \
RUN set -eux; \
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
aarch64|arm64) \
ESUM='e184dc29a6712c1f78754ab36fb48866583665fa345324f1a79e569c064f95e9'; \
BINARY_URL='https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.1_12.tar.gz'; \
;; \
amd64|i386:x86-64) \
ESUM='1a6fa8abda4c5caed915cfbeeb176e7fbd12eb6b222f26e290ee45808b529aa1'; \
BINARY_URL='https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_x64_linux_hotspot_21.0.1_12.tar.gz'; \
;; \
ppc64el|powerpc:common64) \
ESUM='9574828ef3d735a25404ced82e09bf20e1614f7d6403956002de9cfbfcb8638f'; \
BINARY_URL='https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.1_12.tar.gz'; \
;; \
*) \
echo "Unsupported arch: ${ARCH}"; \
exit 1; \
;; \
esac; \
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \
mkdir -p /usr/local/java; \
tar --extract \
--file /tmp/openjdk.tar.gz \
--directory "/usr/local/java" \
--strip-components 1 \
--no-same-owner \
; \
rm -f /tmp/openjdk.tar.gz /usr/local/java/lib/src.zip;
aarch64|arm64) \
ESUM='e184dc29a6712c1f78754ab36fb48866583665fa345324f1a79e569c064f95e9'; \
BINARY_URL='https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.1_12.tar.gz'; \
;; \
amd64|i386:x86-64) \
ESUM='1a6fa8abda4c5caed915cfbeeb176e7fbd12eb6b222f26e290ee45808b529aa1'; \
BINARY_URL='https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_x64_linux_hotspot_21.0.1_12.tar.gz'; \
;; \
ppc64el|powerpc:common64) \
ESUM='9574828ef3d735a25404ced82e09bf20e1614f7d6403956002de9cfbfcb8638f'; \
BINARY_URL='https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.1_12.tar.gz'; \
;; \
*) \
echo "Unsupported arch: ${ARCH}"; \
exit 1; \
;; \
esac; \
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \
mkdir -p /usr/local/java; \
tar --extract \
--file /tmp/openjdk.tar.gz \
--directory "/usr/local/java" \
--strip-components 1 \
--no-same-owner \
; \
rm -f /tmp/openjdk.tar.gz /usr/local/java/lib/src.zip;


########################################################################################################################
Expand All @@ -80,49 +80,49 @@ COPY --from=openjdk-builder /usr/local/java/ /usr/local/java/

# Install Basic OS Requirements
RUN apt-get update && \
apt-get install --yes --no-install-recommends tar gzip openssl zlib1g libsodium23 sudo && \
apt-get install --yes --no-install-recommends libnetty-tcnative-jni && \
apt-get autoremove --yes && \
apt-get autoclean --yes && \
apt-get clean all --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
apt-get install --yes --no-install-recommends tar gzip openssl zlib1g libsodium23 sudo && \
apt-get install --yes --no-install-recommends libnetty-tcnative-jni && \
apt-get autoremove --yes && \
apt-get autoclean --yes && \
apt-get clean all --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/

# Install Java Alternatives
RUN update-alternatives --install "/usr/bin/java" "java" "${JAVA_HOME}/bin/java" 1500 && \
update-alternatives --install "/usr/bin/javac" "javac" "${JAVA_HOME}/bin/javac" 1500 && \
update-alternatives --install "/usr/bin/javadoc" "javadoc" "${JAVA_HOME}/bin/javadoc" 1500 && \
update-alternatives --install "/usr/bin/jshell" "jshell" "${JAVA_HOME}/bin/jshell" 1500 && \
update-alternatives --install "/usr/bin/jstack" "jstack" "${JAVA_HOME}/bin/jstack" 1500 && \
update-alternatives --install "/usr/bin/jps" "jps" "${JAVA_HOME}/bin/jps" 1500 && \
update-alternatives --install "/usr/bin/jmap" "jmap" "${JAVA_HOME}/bin/jmap" 1500
update-alternatives --install "/usr/bin/javac" "javac" "${JAVA_HOME}/bin/javac" 1500 && \
update-alternatives --install "/usr/bin/javadoc" "javadoc" "${JAVA_HOME}/bin/javadoc" 1500 && \
update-alternatives --install "/usr/bin/jshell" "jshell" "${JAVA_HOME}/bin/jshell" 1500 && \
update-alternatives --install "/usr/bin/jstack" "jstack" "${JAVA_HOME}/bin/jstack" 1500 && \
update-alternatives --install "/usr/bin/jps" "jps" "${JAVA_HOME}/bin/jps" 1500 && \
update-alternatives --install "/usr/bin/jmap" "jmap" "${JAVA_HOME}/bin/jmap" 1500

# Create Application Folders
RUN mkdir -p "/opt/hgcapp" && \
mkdir -p "/opt/hgcapp/accountBalances" && \
mkdir -p "/opt/hgcapp/eventsStreams" && \
mkdir -p "/opt/hgcapp/recordStreams" && \
mkdir -p "/opt/hgcapp/services-hedera" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/apps" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/backup" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/config" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/diskFs" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/keys" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/lib" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/onboard" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/stats" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/saved" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/upgrade"
mkdir -p "/opt/hgcapp/accountBalances" && \
mkdir -p "/opt/hgcapp/eventsStreams" && \
mkdir -p "/opt/hgcapp/recordStreams" && \
mkdir -p "/opt/hgcapp/services-hedera" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/apps" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/backup" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/config" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/diskFs" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/keys" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/lib" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/onboard" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/stats" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/saved" && \
mkdir -p "/opt/hgcapp/services-hedera/HapiApp2.0/data/upgrade"

# Configure the standard user account
RUN groupadd --gid 2000 hedera && \
useradd --no-user-group --create-home --uid 2000 --gid 2000 --shell /bin/bash hedera && \
chown -R hedera:hedera /opt/hgcapp
useradd --no-user-group --create-home --uid 2000 --gid 2000 --shell /bin/bash hedera && \
chown -R hedera:hedera /opt/hgcapp

# Configure SUDO support
RUN echo >> /etc/sudoers && \
echo "%hedera ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
echo "%hedera ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers


# Define Volume Bindpoints
Expand Down

0 comments on commit 012062a

Please sign in to comment.