UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Ironbank Containers
G
Galvanize
galvanize
java-code-evaluator
Commits
395fcc42
Commit
395fcc42
authored
Apr 20, 2021
by
thomas.shepherd
Browse files
Merge branch 'upgrade-gradle-base' into 'development'
Upgrade gradle base image. See merge request
!4
parents
412b0821
af7c251c
Pipeline
#227465
passed with stages
in 13 minutes
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
46 deletions
+48
-46
.gitignore
.gitignore
+3
-1
Dockerfile
Dockerfile
+26
-30
README.md
README.md
+1
-1
hardening_manifest.yaml
hardening_manifest.yaml
+3
-3
scripts/Dockerfile.packages
scripts/Dockerfile.packages
+9
-5
scripts/repackage.sh
scripts/repackage.sh
+6
-6
No files found.
.gitignore
View file @
395fcc42
...
@@ -10,4 +10,6 @@ gradlew
...
@@ -10,4 +10,6 @@ gradlew
gradlew.bat
gradlew.bat
gradle
gradle
build_dependencies
build_dependencies
libs
libs
\ No newline at end of file
jars.tar.gz
redis-cli.tar.gz
\ No newline at end of file
Dockerfile
View file @
395fcc42
ARG
BASE_REGISTRY=registry1.dso.mil
ARG
BASE_REGISTRY=registry1.dso.mil
ARG
BASE_IMAGE=opensource/gradle/gradle-jre11
ARG
BASE_IMAGE=opensource/gradle/gradle-jre11
ARG
BASE_TAG=6.
7.1
ARG
BASE_TAG=6.
8.3
FROM
${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
FROM
${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
USER
0
USER
0
# Make sure we are up to date
# Make sure we are up to date
.
RUN
dnf update
-y
&&
dnf clean all
RUN
dnf update
-y
&&
dnf clean all
# Copy in the project files
# Copy in the project files.
WORKDIR
/app
COPY
./scripts \
COPY
./scripts /app
redis-cli.tar.gz \
COPY
redis-cli.tar.gz .
jars.tar.gz /app/
COPY
jars.tar.gz .
# Set workdir.
# Set workdir.
WORKDIR
/app
WORKDIR
/app
# Setup redis.
# Setup redis and jar files.
RUN
tar
xzf redis-cli.tar.gz
&&
rm
redis-cli.tar.gz
RUN
tar
xzf redis-cli.tar.gz
\
RUN
mv
redis-cli /usr/local/bin/redis-cli
&&
rm
redis-cli.tar.gz
\
&&
mv
redis-cli /usr/local/bin/redis-cli
\
# Setup jars.
&&
tar
xzf jars.tar.gz
&&
rm
jars.tar.gz
\
RUN
tar
xzf jars.tar.gz
&&
rm
jars.tar.gz
&&
mkdir
libs
&&
mv
jars/main/
*
libs/
\
RUN
mkdir
libs
&&
mv
jars/main/
*
libs/
&&
mkdir
process_job/libs
&&
mv
jars/process_job/
*
process_job/libs/
\
RUN
mkdir
process_job/libs
&&
mv
jars/process_job/
*
process_job/libs/
&&
mkdir
send_results/libs
&&
mv
jars/send_results/
*
send_results/libs/
\
RUN
mkdir
send_results/libs
&&
mv
jars/send_results/
*
send_results/libs/
&&
rm
-rf
jars
\
RUN
rm
-rf
jars
&&
chown
-R
1000 /app
\
&&
chmod
0555 /app/get-job.sh
# Set permissions and ownership
RUN
chown
-R
1000 /app
# Change to the gradle user.
RUN
chmod
0555 /app/get-job.sh
# Change to the gradle user
USER
1000
USER
1000
# Pre
build, then
build. This should speed things up before processing the first job
# Pre
-
build. This should speed things up before processing the first job
.
RUN
gradle
--offline
build
RUN
gradle
--offline
build
\
RUN
cd
process_job
&&
gradle
--offline
build
&&
cd
..
&&
cd
process_job
&&
gradle
--offline
build
&&
cd
..
\
RUN
cd
send_results
&&
gradle
--offline
build
&&
cd
..
&&
cd
send_results
&&
gradle
--offline
build
&&
cd
..
# Health check
# Health check
.
HEALTHCHECK
none
HEALTHCHECK
none
# Start the job processor
# Start the job processor
.
ENTRYPOINT
["/app/get-job.sh"]
ENTRYPOINT
["/app/get-job.sh"]
\ No newline at end of file
README.md
View file @
395fcc42
...
@@ -8,7 +8,7 @@ code snippets that were submitted from students through the LEARN application.
...
@@ -8,7 +8,7 @@ code snippets that were submitted from students through the LEARN application.
## Requirements:
## Requirements:
-
Redis CLI
-
Redis CLI
-
Java 11
-
Java 11
-
Gradle 6.
7
-
Gradle 6.
8
## Container Usage:
## Container Usage:
...
...
hardening_manifest.yaml
View file @
395fcc42
...
@@ -14,7 +14,7 @@ tags:
...
@@ -14,7 +14,7 @@ tags:
# Build args passed to Dockerfile ARGs
# Build args passed to Dockerfile ARGs
args
:
args
:
BASE_IMAGE
:
"
opensource/gradle/gradle-jre11"
BASE_IMAGE
:
"
opensource/gradle/gradle-jre11"
BASE_TAG
:
"
6.
7.1
"
BASE_TAG
:
"
6.
8.3
"
# Docker image labels
# Docker image labels
labels
:
labels
:
...
@@ -38,7 +38,7 @@ resources:
...
@@ -38,7 +38,7 @@ resources:
filename
:
redis-cli.tar.gz
filename
:
redis-cli.tar.gz
validation
:
validation
:
type
:
sha256
type
:
sha256
value
:
975e37c4165969c4cd612ddd81a69
50
e
87
2f2d9a7a355376a05be4ad901e62f
e
value
:
656bf2fc3f4e63bb4ee96744a5
50
a
87
5b316e3f99da241a378a63db47b91e1e
e
-
auth
:
-
auth
:
type
:
s3
type
:
s3
id
:
galvanize
id
:
galvanize
...
@@ -47,7 +47,7 @@ resources:
...
@@ -47,7 +47,7 @@ resources:
filename
:
jars.tar.gz
filename
:
jars.tar.gz
validation
:
validation
:
type
:
sha256
type
:
sha256
value
:
8d9cbd2da25b8c1792e6fc900c9bd88c7e79005fdacf81fd0765933682b53c21
value
:
179f64dd1799517dbec988e8f54be50496bc7dc093dadcd43ce758d103644357
# List of project maintainers
# List of project maintainers
maintainers
:
maintainers
:
...
...
scripts/Dockerfile.packages
View file @
395fcc42
...
@@ -6,7 +6,8 @@ FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
...
@@ -6,7 +6,8 @@ FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
USER 0
USER 0
# Install required libs.
# Install required libs.
RUN dnf update -y && dnf install -y \
RUN dnf update -y \
&& dnf install -y \
curl \
curl \
make \
make \
gcc \
gcc \
...
@@ -16,13 +17,16 @@ RUN dnf update -y && dnf install -y \
...
@@ -16,13 +17,16 @@ RUN dnf update -y && dnf install -y \
WORKDIR /app
WORKDIR /app
# Redis
# Redis
RUN curl -L http://download.redis.io/redis-stable.tar.gz -o redis-stable.tar.gz
RUN curl -L http://download.redis.io/redis-stable.tar.gz -o redis-stable.tar.gz \
RUN tar xzf redis-stable.tar.gz
&& tar xzf redis-stable.tar.gz
WORKDIR /app/redis-stable
WORKDIR /app/redis-stable
RUN make redis-cli
RUN make redis-cli
WORKDIR /app/redis-stable/src
WORKDIR /app/redis-stable/src
RUN tar czf redis-cli.tar.gz redis-cli
RUN tar czf redis-cli.tar.gz redis-cli \
RUN mv redis-cli.tar.gz /app/
&& mv redis-cli.tar.gz /app/
WORKDIR /app
WORKDIR /app
# Add write permissions.
# Add write permissions.
...
...
scripts/repackage.sh
View file @
395fcc42
#!/
bin/
bash
#!/
usr/bin/env
bash
# Image Params.
# Image Params.
BASE_REGISTRY
=
registry
.il2
.dso.mil
BASE_REGISTRY
=
registry
1
.dso.mil
BASE_IMAGE
=
platform-one/devops/pipeline-templates/ironbank
/gradle-jre11
BASE_IMAGE
=
ironbank/opensource/gradle
/gradle-jre11
BASE_TAG
=
6.
7.1
BASE_TAG
=
6.
8.3
# This is the profile name in your aws credentials file.
# This is the profile name in your aws credentials file.
DEPENDENCY_FOLDER
=
build_dependencies
DEPENDENCY_FOLDER
=
build_dependencies
...
@@ -23,11 +23,11 @@ IMAGE_ID=$(docker build --file Dockerfile.packages . -q \
...
@@ -23,11 +23,11 @@ IMAGE_ID=$(docker build --file Dockerfile.packages . -q \
echo
"Image ID:
${
IMAGE_ID
}
"
echo
"Image ID:
${
IMAGE_ID
}
"
echo
"Starting docker container."
echo
"Starting docker container."
CONTAINER_ID
=
$(
docker run
-d
"
$IMAGE_ID
"
)
CONTAINER_ID
=
$(
docker run
-d
$IMAGE_ID
)
echo
"Container ID:
${
CONTAINER_ID
}
"
echo
"Container ID:
${
CONTAINER_ID
}
"
echo
"Copying node modules and gems to the bundles directory."
echo
"Copying node modules and gems to the bundles directory."
docker
cp
"
$CONTAINER_ID
"
:/app/redis-cli.tar.gz
$DEPENDENCY_FOLDER
docker
cp
$CONTAINER_ID
:/app/redis-cli.tar.gz
$DEPENDENCY_FOLDER
/redis-cli.tar.gz
echo
"Stopping the docker container."
echo
"Stopping the docker container."
docker stop
"
$CONTAINER_ID
"
docker stop
"
$CONTAINER_ID
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment