-
Notifications
You must be signed in to change notification settings - Fork 319
add ghost v2 docker images #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fdf98e2
to
ede162a
Compare
ede162a
to
f683bba
Compare
mkdir -p "$GHOST_CONTENT"; \ | ||
chown node:node "$GHOST_CONTENT" | ||
|
||
# TODO multiarch sqlite3 (once either "node:6-alpine" has multiarch or we switch to a base that does) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, probably time to revisit this (although not going to hold this up to do so). 👍
Here's a slightly better diff: (since GitHub doesn't support diff --git a/.travis.yml b/.travis.yml
index ac01164..31869e1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,6 +2,8 @@ language: bash
services: docker
env:
+ - VERSION=2 VARIANT=debian
+ - VERSION=2 VARIANT=alpine
- VERSION=1 VARIANT=debian
- VERSION=1 VARIANT=alpine
- VERSION=0 VARIANT=debian
diff --git a/1/alpine/Dockerfile b/2/alpine/Dockerfile
similarity index 77%
copy from 1/alpine/Dockerfile
copy to 2/alpine/Dockerfile
index 847add9..1fc8a6c 100644
--- a/1/alpine/Dockerfile
+++ b/2/alpine/Dockerfile
@@ -17,7 +17,7 @@ RUN npm install -g "ghost-cli@$GHOST_CLI_VERSION"
ENV GHOST_INSTALL /var/lib/ghost
ENV GHOST_CONTENT /var/lib/ghost/content
-ENV GHOST_VERSION 1.25.5
+ENV GHOST_VERSION 2.0.3
RUN set -ex; \
mkdir -p "$GHOST_INSTALL"; \
@@ -37,14 +37,7 @@ RUN set -ex; \
# need to save initial content for pre-seeding empty volumes
mv "$GHOST_CONTENT" "$GHOST_INSTALL/content.orig"; \
mkdir -p "$GHOST_CONTENT"; \
- chown node:node "$GHOST_CONTENT"; \
- \
-# sanity check to ensure knex-migrator was installed
- "$GHOST_INSTALL/current/node_modules/knex-migrator/bin/knex-migrator" --version
-
-# add knex-migrator bins into PATH
-# we want these from the context of Ghost's "node_modules" directory (instead of doing "npm install -g knex-migrator") so they can share the DB driver modules
-ENV PATH $PATH:$GHOST_INSTALL/current/node_modules/knex-migrator/bin
+ chown node:node "$GHOST_CONTENT"
# TODO multiarch sqlite3 (once either "node:6-alpine" has multiarch or we switch to a base that does)
diff --git a/1/alpine/docker-entrypoint.sh b/2/alpine/docker-entrypoint.sh
similarity index 89%
copy from 1/alpine/docker-entrypoint.sh
copy to 2/alpine/docker-entrypoint.sh
index 21eee25..bedd4fa 100755
--- a/1/alpine/docker-entrypoint.sh
+++ b/2/alpine/docker-entrypoint.sh
@@ -17,8 +17,6 @@ if [[ "$*" == node*current/index.js* ]]; then
tar -cC "$(dirname "$src")" "$(basename "$src")" | tar -xC "$(dirname "$target")"
fi
done
-
- knex-migrator-migrate --init --mgpath "$GHOST_INSTALL/current"
fi
exec "$@"
diff --git a/1/debian/Dockerfile b/2/debian/Dockerfile
similarity index 87%
copy from 1/debian/Dockerfile
copy to 2/debian/Dockerfile
index a834190..8c8e63a 100644
--- a/1/debian/Dockerfile
+++ b/2/debian/Dockerfile
@@ -23,7 +23,7 @@ RUN npm install -g "ghost-cli@$GHOST_CLI_VERSION"
ENV GHOST_INSTALL /var/lib/ghost
ENV GHOST_CONTENT /var/lib/ghost/content
-ENV GHOST_VERSION 1.25.5
+ENV GHOST_VERSION 2.0.3
RUN set -ex; \
mkdir -p "$GHOST_INSTALL"; \
@@ -43,14 +43,7 @@ RUN set -ex; \
# need to save initial content for pre-seeding empty volumes
mv "$GHOST_CONTENT" "$GHOST_INSTALL/content.orig"; \
mkdir -p "$GHOST_CONTENT"; \
- chown node:node "$GHOST_CONTENT"; \
- \
-# sanity check to ensure knex-migrator was installed
- "$GHOST_INSTALL/current/node_modules/knex-migrator/bin/knex-migrator" --version
-
-# add knex-migrator bins into PATH
-# we want these from the context of Ghost's "node_modules" directory (instead of doing "npm install -g knex-migrator") so they can share the DB driver modules
-ENV PATH $PATH:$GHOST_INSTALL/current/node_modules/knex-migrator/bin
+ chown node:node "$GHOST_CONTENT"
RUN set -eux; \
# force install "sqlite3" manually since it's an optional dependency of "ghost"
diff --git a/1/debian/docker-entrypoint.sh b/2/debian/docker-entrypoint.sh
similarity index 89%
copy from 1/debian/docker-entrypoint.sh
copy to 2/debian/docker-entrypoint.sh
index 1060b05..c7bfbe3 100755
--- a/1/debian/docker-entrypoint.sh
+++ b/2/debian/docker-entrypoint.sh
@@ -17,8 +17,6 @@ if [[ "$*" == node*current/index.js* ]]; then
tar -cC "$(dirname "$src")" "$(basename "$src")" | tar -xC "$(dirname "$target")"
fi
done
-
- knex-migrator-migrate --init --mgpath "$GHOST_INSTALL/current"
fi
exec "$@" |
(The parts that are gone are some of the parts that have been the most annoying!! 🎉 ❤️) |
- `docker`: 18.06.1-ce GA - `ghost`: Ghost 2.0! (docker-library/ghost#145) - `golang`: remove unused files (docker-library/golang#232) - `postgres`: add `stretch-backports` when building 11+ from source (docker-library/postgres#485)
The image works when deploying a new Ghost instance, however it doesn't work when updating from a previous Ghost v1 blog because it doesn't migrate the old DB. To be more precise, the problem is the new |
See #147, especially #147 (comment):
|
closes #142
Main difference from ghost v1 is that knex-migrator is no longer needed outside of Ghost - Ghost itself will run it on boot.