-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile for repos crushftp-source
- Loading branch information
Showing
4 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
**/dist | ||
LICENSE | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# alpine:3.13 | ||
# buildargs: REPO=alpine:3.13 CRUSHFTP_VERSION=10.0.0_44 SOURCE_METHOD=wget or add SOURCE_ZIP=https://www.crushftp.com/early10/CrushFTP10.zip | ||
ARG REPO=alpine:3.13 | ||
ARG SOURCE_METHOD=wget | ||
|
||
FROM $REPO AS base | ||
|
||
FROM base AS base-source | ||
RUN apk upgrade --no-cache \ | ||
&& apk --no-cache add ca-certificates curl wget zip | ||
WORKDIR /tmp | ||
|
||
FROM base-source AS source-wget | ||
# source CrushFTP10.zip without java included | ||
ARG SOURCE_ZIP=https://www.crushftp.com/early10/CrushFTP10.zip | ||
RUN wget -q -O CrushFTP10.zip $SOURCE_ZIP | ||
|
||
FROM base-source AS source-add | ||
# source CrushFTP10.zip without java included | ||
ARG SOURCE_ZIP=https://www.crushftp.com/early10/CrushFTP10.zip | ||
ADD $SOURCE_ZIP CrushFTP10.zip | ||
|
||
FROM source-$SOURCE_METHOD AS zip | ||
# unzip to destination /tmp/CrushFTP10 | ||
RUN unzip -oq CrushFTP10.zip | ||
# create folder /src if not exist | ||
WORKDIR /src | ||
RUN cd /tmp/CrushFTP10 \ | ||
&& zip -qr9 /src/crushftp.zip * \ | ||
&& date '+%F %T %z'>/src/__builddate.txt | ||
|
||
FROM base as final | ||
WORKDIR /src | ||
COPY --from=zip /src . | ||
|
||
ARG CRUSHFTP_VERSION=10.0.0_44 | ||
ENV CRUSHFTP_VERSION=$CRUSHFTP_VERSION | ||
LABEL org.opencontainers.image.authors="https://github.com/NetLah" | ||
LABEL org.opencontainers.image.url="https://hub.docker.com/r/netlah/crushftp-source" | ||
LABEL org.opencontainers.image.source="https://github.com/NetLah/docker-crushftp" | ||
LABEL org.opencontainers.image.description="Intermediate docker image for crushftp.zip." | ||
LABEL org.opencontainers.image.version="$CRUSHFTP_VERSION" | ||
LABEL version="$CRUSHFTP_VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# CrushFTP 10 Source | ||
|
||
This intermediate docker image contains crushftp.zip for next docker build image Crushftp server. | ||
|
||
## Docker Specifications | ||
|
||
- Base: Alpine 3.13 Linux | ||
- CrushFTP 10 (v10.0.0_44) | ||
- Repository: [hub.docker.com/r/netlah/crushftp](hub.docker.com/r/netlah/crushftp) | ||
- Docker: [hub.docker.com/r/netlah/crushftp-source](hub.docker.com/r/netlah/crushftp-source) | ||
|
||
## Content | ||
|
||
``` | ||
/src/crushftp.zip | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
echo "Current Dir: $(pwd)" | ||
echo "SOURCE_BRANCH: ${SOURCE_BRANCH}" | ||
echo "SOURCE_COMMIT: ${SOURCE_COMMIT}" | ||
echo "COMMIT_MSG: ${COMMIT_MSG}" | ||
echo "DOCKER_REPO: ${DOCKER_REPO}" | ||
echo "DOCKERFILE_PATH: ${DOCKERFILE_PATH}" | ||
echo "DOCKER_TAG: ${DOCKER_TAG}" | ||
echo "IMAGE_NAME: ${IMAGE_NAME}" | ||
|
||
IMAGE_NAME1="${DOCKER_REPO}:${SOURCE_COMMIT:0:7}" | ||
DOCKER_BUID="DOCKER_BUILDKIT=1 docker build . -f $DOCKERFILE_PATH -t $IMAGE_NAME -t $IMAGE_NAME1" | ||
|
||
if [[ ! -z "${REPO}" ]]; then | ||
echo "-- REPO: ${REPO}" | ||
DOCKER_BUID="$DOCKER_BUID --build-arg REPO=$REPO" | ||
fi | ||
|
||
echo "Docker build: ${DOCKER_BUID}" | ||
eval $DOCKER_BUID | ||
|
||
ret_val=$? | ||
if [ ${ret_val} -eq 0 ]; then | ||
echo "Pushing: ${IMAGE_NAME1} for ${SOURCE_COMMIT}" | ||
docker push ${IMAGE_NAME1} | ||
else | ||
exit ret_val | ||
fi |