Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8302e34

Browse files
committed
support for building custom images
1 parent 213fb32 commit 8302e34

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

‎build.sh

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,33 @@ info "Building image ${BUILDNAME} ...
125125
docker build -t $BUILDNAME \
126126
--build-arg BUILD_CONFIG="${CONFIG_DIR}" \
127127
--build-arg BUILD_VERSION="${CONFIG_VER}" \
128-
.
128+
.
129+
130+
#Build custom images based on the previously built image
131+
if [ -d "$PWD/custom" ]; then
132+
133+
BUILD_DIR=$PWD/custom
134+
135+
cd "$BUILD_DIR"
136+
137+
for i in * ; do
138+
139+
if [ -d "$i" ] && [ -f "${BUILD_DIR}/${i}/Dockerfile" ]; then
140+
141+
DOCKERFILE_PATH="${BUILD_DIR}/${i}/Dockerfile"
142+
info "Building custom image $i:latest ..."
143+
144+
docker build -t $i \
145+
-f "${DOCKERFILE_PATH}" \
146+
--build-arg BUILD_FROM="${BUILDNAME}" \
147+
"$BUILD_DIR/$i"
148+
149+
fi
150+
151+
done
152+
153+
fi
154+
129155

130156

131157

‎custom/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!example

‎custom/example/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#Arguments
2+
ARG BUILD_FROM=test
3+
4+
FROM $BUILD_FROM
5+
6+
#Start your customizations here
7+
8+
#Example
9+
#
10+
#PostregSQL and zip suppoer
11+
#RUN set -ex \
12+
# && apk --no-cache add postgresql-dev \
13+
# && docker-php-ext-install pdo pdo_pgsql zip
14+
15+
#Expose port 80
16+
#EXPOSE 80

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /