Skip to content

Commit f34a1e2

Browse files
committed
CF-4251:docker image for postgreSQL array fix
1 parent 5acd340 commit f34a1e2

File tree

2 files changed

+17
-75
lines changed

2 files changed

+17
-75
lines changed

docker/Dockerfile

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,9 @@ 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-
166
LABEL maintainer="AtomHopperTeam@rackspace.com" \
177
#Atom Hopper version
18-
version="1.2.35" \
8+
version="1.2.33" \
199
description="Docker image for Atom Hopper"
2010

2111
#The database type
@@ -26,46 +16,27 @@ ENV DB_TYPE=H2 \
2616
DB_PASSWORD= \
2717
#Database Host:Port
2818
DB_HOST=h2 \
29-
AH_VERSION=1.2.35 \
19+
AH_VERSION=1.2.33 \
3020
CATALINA_HOME=/opt/tomcat \
3121
AH_HOME=/opt/atomhopper \
3222
PATH=${PATH}:${CATALINA_HOME}/bin:${AH_HOME}
3323

34-
RUN mkdir -p "${CATALINA_HOME}" "${AH_HOME}" /etc/atomhopper/ /var/log/atomhopper/
24+
RUN mkdir -p "${CATALINA_HOME}" "${AH_HOME}" /etc/atomhopper/ /var/log/atomhopper/
3525

3626
WORKDIR ${AH_HOME}
3727

3828
COPY --from=tomcat /usr/local/tomcat ${CATALINA_HOME}
39-
COPY docker/start.sh .
29+
COPY start.sh .
4030

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..." \
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 \
6033
&& unzip atomhopper.war META-INF/application-context.xml META-INF/template-logback.xml WEB-INF/classes/META-INF/atom-server.cfg.xml -d . \
6134
&& mv META-INF/application-context.xml WEB-INF/classes/META-INF/atom-server.cfg.xml /etc/atomhopper/ \
6235
&& mv META-INF/template-logback.xml /etc/atomhopper/logback.xml \
6336
&& mv atomhopper.war ${CATALINA_HOME}/webapps/ROOT.war \
6437
&& rm -rf META-INF WEB-INF \
65-
&& chmod +x ${AH_HOME}/start.sh \
66-
&& echo "AtomHopper ${AH_VERSION} setup completed successfully"
38+
&& chmod +x ${AH_HOME}/start.sh
6739

6840
EXPOSE 8080
6941

7042
CMD ["start.sh"]
71-

docker/README.md

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,10 @@
1-
# docker build image and run the container
2-
3-
## Building the Docker Image
4-
5-
Your current directory should be pointing to ***atom-hopper/docker***.
6-
7-
### Prerequisites
8-
The Docker build now downloads AtomHopper from GitHub Packages, which requires authentication. You need:
9-
- A GitHub Personal Access Token with `packages:read` permission
10-
- Your GitHub username
11-
12-
### Build Command
13-
Run the following command to build an image with GitHub authentication:
14-
```bash
15-
docker build \
16-
--build-arg GITHUB_TOKEN=your_github_token \
17-
--build-arg GITHUB_ACTOR=your_github_username \
18-
-t atomhopper:latest-alpine .
1+
# docker build image and run the conatiner
2+
Your current direcotry should be pointing to ***atom-hopper/docker***.
3+
Run the following command to build an image.
194
```
20-
21-
### Alternative: Using Environment Variables
22-
You can also set environment variables and build:
23-
```bash
24-
export GITHUB_TOKEN=your_github_token
25-
export GITHUB_ACTOR=your_github_username
26-
docker build \
27-
--build-arg GITHUB_TOKEN=$GITHUB_TOKEN \
28-
--build-arg GITHUB_ACTOR=$GITHUB_ACTOR \
29-
-t atomhopper:latest-alpine .
30-
```
31-
## Running the Container
32-
33-
You can use the following command to run a container by providing the appropriate values to the variables.
5+
$docker build -t atomhopper:latest-alpine .
6+
```
7+
You can use the following command to run a container by provinding the appropriate values to the variables.
348
```
359
$docker run -d --name [Conatiner_Name] -p 8080:8080 -e DB_TYPE=[Database_Type (PostgreSQL, MySQL)] -e DB_USER=[Database_Username] -e DB_PASSWORD=[Database_Password] -e DB_HOST=[IP:PORT] atomhopper:latest-alpine
3610
```
@@ -43,19 +17,16 @@ Test the sample feed at http://localhost:8080/namespace/feed
4317

4418
H2 is the default databse configured to be used. The databse file for this is present under */opt/atomhopper*
4519

46-
Following environment variables are set by default
20+
Following environment variables are set by default
4721
```
4822
JAVA_HOME "/opt/java/openjdk8/jre"
4923
CATALINA_HOME "/opt/tomcat"
5024
AH_HOME "/opt/atomhopper"
51-
AH_VERSION "1.2.35"
25+
AH_VERSION "1.2.33"
5226
```
5327
For specific databse configuration of your choice (PostgreSQL,MySQL) provide values for the variables DB_TYPE, DB_USER, DB_PASSWORD and DB_HOST
5428

55-
Example of running with a PostgreSQL databse hosted externally.
29+
Example of running with a PostgreSQL databse hosted externally.
5630
```
5731
$docker run -d --name atomhopper -p 8080:8080 -e DB_TYPE=PostgreSQL -e DB_USER=postgresql -e DB_PASSWORD=postgresql -e DB_HOST=10.0.0.1:5432 atomhopper:latest-alpine
58-
```
59-
60-
61-
32+
```

0 commit comments

Comments
 (0)