Skip to content

Commit 5c58ed6

Browse files
committed
Fix ECS container startup issue
- Use absolute path in CMD instruction: /opt/atomhopper/start.sh - Restore GitHub Packages authentication setup - Update version to 1.2.35 - Add verification of start.sh file permissions - Ensure proper file copying and executable permissions
1 parent 410d37a commit 5c58ed6

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

docker/Dockerfile

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@ FROM tomcat:9.0.41-jdk8 as tomcat
33

44
FROM adoptopenjdk/openjdk8:alpine-slim
55

6+
# Build arguments for GitHub authentication
7+
ARG GITHUB_TOKEN
8+
ARG GITHUB_ACTOR
9+
10+
# Validate that authentication arguments are provided
11+
RUN if [ -z "$GITHUB_TOKEN" ] || [ -z "$GITHUB_ACTOR" ]; then \
12+
echo "ERROR: GITHUB_TOKEN and GITHUB_ACTOR build arguments are required for GitHub Packages authentication"; \
13+
exit 1; \
14+
fi
15+
616
LABEL maintainer="AtomHopperTeam@rackspace.com" \
717
#Atom Hopper version
8-
version="1.2.33" \
18+
version="1.2.35" \
919
description="Docker image for Atom Hopper"
1020

1121
#The database type
@@ -16,7 +26,7 @@ ENV DB_TYPE=H2 \
1626
DB_PASSWORD= \
1727
#Database Host:Port
1828
DB_HOST=h2 \
19-
AH_VERSION=1.2.33 \
29+
AH_VERSION=1.2.35 \
2030
CATALINA_HOME=/opt/tomcat \
2131
AH_HOME=/opt/atomhopper \
2232
PATH=${PATH}:${CATALINA_HOME}/bin:${AH_HOME}
@@ -28,15 +38,35 @@ WORKDIR ${AH_HOME}
2838
COPY --from=tomcat /usr/local/tomcat ${CATALINA_HOME}
2939
COPY docker/start.sh .
3040

31-
RUN apk --no-cache add curl \
32-
&& curl -o atomhopper.war https://maven.research.rackspacecloud.com/content/repositories/releases/org/atomhopper/atomhopper/${AH_VERSION}/atomhopper-${AH_VERSION}.war \
41+
RUN apk --no-cache add curl unzip file \
42+
&& echo "Downloading AtomHopper ${AH_VERSION} from GitHub Packages..." \
43+
&& echo "URL: https://maven.pkg.github.com/rackerlabs/atom-hopper/org/atomhopper/atomhopper/${AH_VERSION}/atomhopper-${AH_VERSION}.war" \
44+
&& curl -v -u ${GITHUB_ACTOR}:${GITHUB_TOKEN} -o atomhopper.war \
45+
"https://maven.pkg.github.com/rackerlabs/atom-hopper/org/atomhopper/atomhopper/${AH_VERSION}/atomhopper-${AH_VERSION}.war" \
46+
&& echo "Download completed. File info:" \
47+
&& ls -la atomhopper.war \
48+
&& file atomhopper.war \
49+
&& echo "First 200 bytes of downloaded file:" \
50+
&& head -c 200 atomhopper.war \
51+
&& echo "" \
52+
&& echo "Checking if file is a valid ZIP/WAR..." \
53+
&& if ! unzip -t atomhopper.war > /dev/null 2>&1; then \
54+
echo "ERROR: Downloaded file is not a valid WAR/ZIP file"; \
55+
echo "Content of downloaded file:"; \
56+
cat atomhopper.war; \
57+
exit 1; \
58+
fi \
59+
&& echo "Extracting configuration files..." \
3360
&& unzip atomhopper.war META-INF/application-context.xml META-INF/template-logback.xml WEB-INF/classes/META-INF/atom-server.cfg.xml -d . \
3461
&& mv META-INF/application-context.xml WEB-INF/classes/META-INF/atom-server.cfg.xml /etc/atomhopper/ \
3562
&& mv META-INF/template-logback.xml /etc/atomhopper/logback.xml \
3663
&& mv atomhopper.war ${CATALINA_HOME}/webapps/ROOT.war \
3764
&& rm -rf META-INF WEB-INF \
38-
&& chmod +x ${AH_HOME}/start.sh
65+
&& chmod +x ${AH_HOME}/start.sh \
66+
&& echo "Verifying start.sh file..." \
67+
&& ls -la ${AH_HOME}/start.sh \
68+
&& echo "AtomHopper ${AH_VERSION} setup completed successfully"
3969

4070
EXPOSE 8080
4171

42-
CMD ["start.sh"]
72+
CMD ["/opt/atomhopper/start.sh"]

0 commit comments

Comments
 (0)