Skip to content
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

Update Dockerfile base image alpine3.20->alpine3.21 #428

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

locohamster
Copy link
Contributor

@locohamster locohamster commented Jan 5, 2025

Just a base image bump to the latest. I was looking on the security scans of the image and there a quite few. I'm providing this version bump and trying to investigate how to resolve serious ones.

@acburdine
Copy link
Collaborator

@tianon or @yosifkit may have to confirm here - but the reason alpine wasn't updated to 3.21 originally is because node 18 doesn't work with it, and there are issues updating to node 20 on some architectures. See #425. Those reasons may not be valid anymore, but either way I think updating to latest alpine is a bit more complicated than just updating the base image

@locohamster
Copy link
Contributor Author

loco@new-docker:~/code/ghost/5/alpine$ docker build . -t ghost:loco
[+] Building 314.5s (13/13) FINISHED                                                                                                                                                                                                                             docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                       0.1s
 => => transferring dockerfile: 4.63kB                                                                                                                                                                                                                                     0.0s
 => [internal] load metadata for docker.io/library/node:18-alpine3.21                                                                                                                                                                                                      1.4s
 => [internal] load .dockerignore                                                                                                                                                                                                                                          0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                            0.0s
 => [1/8] FROM docker.io/library/node:18-alpine3.21@sha256:6eb9c3d9bd191bd2cc6ce7ec3d5ec4c2127616140c8586af96a6bec8f28689d1                                                                                                                                                4.0s
 => => resolve docker.io/library/node:18-alpine3.21@sha256:6eb9c3d9bd191bd2cc6ce7ec3d5ec4c2127616140c8586af96a6bec8f28689d1                                                                                                                                                0.1s
 => => sha256:e27d763222484061b437681bbee7cd895e8d87309da7ac7a908ba3e77d284802 1.26MB / 1.26MB                                                                                                                                                                             0.3s
 => => sha256:fdd316e9b466cfe32b99c16ab15ffa368056b7cc2cac442ffe71a21ed72c5af4 445B / 445B                                                                                                                                                                                 0.6s
 => => sha256:6eb9c3d9bd191bd2cc6ce7ec3d5ec4c2127616140c8586af96a6bec8f28689d1 7.67kB / 7.67kB                                                                                                                                                                             0.0s
 => => sha256:319e89e3b74c302eaac5d0652aacf1c8843746749cc98780816f684f2dcb1bc1 1.72kB / 1.72kB                                                                                                                                                                             0.0s
 => => sha256:e907c843e7bd858cd91fdbef98fb34c879d7ff6338b73ba1c94df7a07c58e586 6.18kB / 6.18kB                                                                                                                                                                             0.0s
 => => sha256:1b970ccead88ff493a9a12d0acf237ca14ceddd7c1c276350396f860b42d88b0 40.00MB / 40.00MB                                                                                                                                                                           1.6s
 => => extracting sha256:1b970ccead88ff493a9a12d0acf237ca14ceddd7c1c276350396f860b42d88b0                                                                                                                                                                                  1.9s
 => => extracting sha256:e27d763222484061b437681bbee7cd895e8d87309da7ac7a908ba3e77d284802                                                                                                                                                                                  0.1s
 => => extracting sha256:fdd316e9b466cfe32b99c16ab15ffa368056b7cc2cac442ffe71a21ed72c5af4                                                                                                                                                                                  0.0s
 => [internal] load build context                                                                                                                                                                                                                                          0.0s
 => => transferring context: 659B                                                                                                                                                                                                                                          0.0s
 => [2/8] RUN apk add --no-cache   bash                                                                                                                                                                                                                                    5.1s
 => [3/8] RUN set -eux;   apk add --no-cache --virtual .gosu-deps   ca-certificates   dpkg   gnupg  ;   dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')";  wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/1.17/gosu-$dpkg  9.6s
 => [4/8] RUN set -eux; ln -svf gosu /usr/local/bin/su-exec; su-exec nobody true # backwards compatibility (TODO remove in Ghost 6+)                                                                                                                                       0.5s
 => [5/8] RUN set -eux;  npm install -g "[email protected]";  npm cache clean --force                                                                                                                                                                                      91.7s
 => [6/8] RUN set -eux;  mkdir -p "/var/lib/ghost";  chown node:node "/var/lib/ghost";   apkDel=;   installCmd='gosu node ghost install "$GHOST_VERSION" --db mysql --dbhost mysql --no-prompt --no-stack --no-setup --dir "$GHOST_INSTALL"';  if ! eval "$installCmd";  174.7s
 => [7/8] WORKDIR /var/lib/ghost                                                                                                                                                                                                                                           0.1s
 => [8/8] COPY docker-entrypoint.sh /usr/local/bin                                                                                                                                                                                                                         0.0s
 => exporting to image                                                                                                                                                                                                                                                    26.9s
 => => exporting layers                                                                                                                                                                                                                                                   26.9s
 => => writing image sha256:277b1e7805124be0f2712963f9723800aa71c03220c921a1bd7ef998552a3957                                                                                                                                                                               0.0s
 => => naming to docker.io/library/ghost:loco                                                                                                                                                                                                                              0.0s
loco@new-docker:~/code/ghost/5/alpine$ docker run -d --name ghost-3-21 -e NODE_ENV=development -e url=http://192.168.1.32:3003 -p 3003:2368 ghost:loco
002864f816291fe5fdbbf413866b36f87a422cdbaa0208178a31bd76aea96587
loco@new-docker:~/code/ghost/5/alpine$ docker logs ghost-3-21
[2025-01-05 20:39:35] INFO Ghost is running in development...
[2025-01-05 20:39:35] INFO Listening on: :::2368
[2025-01-05 20:39:35] INFO Url configured as: http://192.168.1.32:3003/
[2025-01-05 20:39:35] INFO Ctrl+C to shut down
[2025-01-05 20:39:35] INFO Ghost server started in 0.735s
[2025-01-05 20:39:35] WARN Database state requires initialisation.
[2025-01-05 20:39:36] INFO Creating table: newsletters
[2025-01-05 20:39:36] INFO Creating table: posts
[2025-01-05 20:39:36] INFO Creating table: posts_meta
[2025-01-05 20:39:36] INFO Creating table: users
[2025-01-05 20:39:36] INFO Creating table: posts_authors
[2025-01-05 20:39:36] INFO Creating table: roles
[2025-01-05 20:39:36] INFO Creating table: roles_users
[2025-01-05 20:39:36] INFO Creating table: permissions
[2025-01-05 20:39:36] INFO Creating table: permissions_users
[2025-01-05 20:39:36] INFO Creating table: permissions_roles
[2025-01-05 20:39:36] INFO Creating table: settings
[2025-01-05 20:39:36] INFO Creating table: tags
[2025-01-05 20:39:36] INFO Creating table: posts_tags
[2025-01-05 20:39:36] INFO Creating table: invites
[2025-01-05 20:39:36] INFO Creating table: brute
[2025-01-05 20:39:36] INFO Creating table: sessions
[2025-01-05 20:39:36] INFO Creating table: integrations
[2025-01-05 20:39:36] INFO Creating table: webhooks
[2025-01-05 20:39:36] INFO Creating table: api_keys
[2025-01-05 20:39:36] INFO Creating table: mobiledoc_revisions
[2025-01-05 20:39:36] INFO Creating table: post_revisions
[2025-01-05 20:39:36] INFO Creating table: members
[2025-01-05 20:39:36] INFO Creating table: products
[2025-01-05 20:39:36] INFO Creating table: offers
[2025-01-05 20:39:37] INFO Creating table: benefits
[2025-01-05 20:39:37] INFO Creating table: products_benefits
[2025-01-05 20:39:37] INFO Creating table: members_products
[2025-01-05 20:39:37] INFO Creating table: posts_products
[2025-01-05 20:39:37] INFO Creating table: members_created_events
[2025-01-05 20:39:37] INFO Creating table: members_cancel_events
[2025-01-05 20:39:37] INFO Creating table: members_payment_events
[2025-01-05 20:39:37] INFO Creating table: members_login_events
[2025-01-05 20:39:37] INFO Creating table: members_email_change_events
[2025-01-05 20:39:37] INFO Creating table: members_status_events
[2025-01-05 20:39:37] INFO Creating table: members_product_events
[2025-01-05 20:39:37] INFO Creating table: members_paid_subscription_events
[2025-01-05 20:39:37] INFO Creating table: labels
[2025-01-05 20:39:37] INFO Creating table: members_labels
[2025-01-05 20:39:37] INFO Creating table: members_stripe_customers
[2025-01-05 20:39:37] INFO Creating table: subscriptions
[2025-01-05 20:39:37] INFO Creating table: members_stripe_customers_subscriptions
[2025-01-05 20:39:37] INFO Creating table: members_subscription_created_events
[2025-01-05 20:39:37] INFO Creating table: offer_redemptions
[2025-01-05 20:39:37] INFO Creating table: members_subscribe_events
[2025-01-05 20:39:37] INFO Creating table: donation_payment_events
[2025-01-05 20:39:37] INFO Creating table: stripe_products
[2025-01-05 20:39:37] INFO Creating table: stripe_prices
[2025-01-05 20:39:37] INFO Creating table: actions
[2025-01-05 20:39:37] INFO Creating table: emails
[2025-01-05 20:39:37] INFO Creating table: email_batches
[2025-01-05 20:39:37] INFO Creating table: email_recipients
[2025-01-05 20:39:37] INFO Creating table: email_recipient_failures
[2025-01-05 20:39:37] INFO Creating table: tokens
[2025-01-05 20:39:37] INFO Creating table: snippets
[2025-01-05 20:39:37] INFO Creating table: custom_theme_settings
[2025-01-05 20:39:37] INFO Creating table: members_newsletters
[2025-01-05 20:39:37] INFO Creating table: comments
[2025-01-05 20:39:37] INFO Creating table: comment_likes
[2025-01-05 20:39:37] INFO Creating table: comment_reports
[2025-01-05 20:39:37] INFO Creating table: jobs
[2025-01-05 20:39:37] INFO Creating table: redirects
[2025-01-05 20:39:37] INFO Creating table: members_click_events
[2025-01-05 20:39:37] INFO Creating table: members_feedback
[2025-01-05 20:39:37] INFO Creating table: suppressions
[2025-01-05 20:39:37] INFO Creating table: email_spam_complaint_events
[2025-01-05 20:39:37] INFO Creating table: mentions
[2025-01-05 20:39:37] INFO Creating table: milestones
[2025-01-05 20:39:37] INFO Creating table: temp_mail_events
[2025-01-05 20:39:37] INFO Creating table: collections
[2025-01-05 20:39:37] INFO Creating table: collections_posts
[2025-01-05 20:39:37] INFO Creating table: recommendations
[2025-01-05 20:39:37] INFO Creating table: recommendation_click_events
[2025-01-05 20:39:37] INFO Creating table: recommendation_subscribe_events
[2025-01-05 20:39:38] INFO Model: Collection
[2025-01-05 20:39:38] INFO Model: Product
[2025-01-05 20:39:38] INFO Model: Newsletter
[2025-01-05 20:39:38] INFO Model: Tag
[2025-01-05 20:39:38] INFO Model: Permission
[2025-01-05 20:39:39] INFO Model: Post
[2025-01-05 20:39:39] INFO Model: Integration
[2025-01-05 20:39:39] INFO Relation: Role to Permission
[2025-01-05 20:39:40] INFO Relation: Post to Tag
[2025-01-05 20:39:40] INFO Database is in a ready state.
[2025-01-05 20:39:40] INFO Ghost database ready in 5.813s
[2025-01-05 20:39:42] INFO Invalidating assets for regeneration
[2025-01-05 20:39:43] INFO Adding offloaded job to the inline job queue
[2025-01-05 20:39:43] INFO Scheduling job mentions-email-report at 32 43 * * * *. Next run on: Sun Jan 05 2025 20:43:32 GMT+0000 (Coordinated Universal Time)
[2025-01-05 20:39:43] INFO Ghost URL Service Ready in 8.469s
[2025-01-05 20:39:43] INFO Adding one-off job to inlineQueue with current length = 0 called 'members-migrations'
[2025-01-05 20:39:43] INFO Stripe not configured - skipping migrations
[2025-01-05 20:39:44] INFO Adding offloaded job to the inline job queue
[2025-01-05 20:39:44] INFO Scheduling job clean-expired-comped at 0 0 3 * * *. Next run on: Mon Jan 06 2025 03:00:00 GMT+0000 (Coordinated Universal Time)
[2025-01-05 20:39:44] INFO Adding offloaded job to the inline job queue
[2025-01-05 20:39:44] INFO Scheduling job clean-tokens at 27 12 15 * * *. Next run on: Mon Jan 06 2025 15:12:27 GMT+0000 (Coordinated Universal Time)
[2025-01-05 20:39:44] INFO Ghost booted in 9.077s
[2025-01-05 20:39:44] INFO Adding offloaded job to the inline job queue
[2025-01-05 20:39:44] INFO Scheduling job update-check at 53 58 12 * * *. Next run on: Mon Jan 06 2025 12:58:53 GMT+0000 (Coordinated Universal Time)
[2025-01-05 20:39:44] INFO Running milestone emails job on Sun Jan 05 2025 20:39:49 GMT+0000 (Coordinated Universal Time)
[2025-01-05 20:39:47] INFO "GET /favicon.ico" 200 11ms
[2025-01-05 20:39:47] INFO "GET /" 200 1183ms
[2025-01-05 20:39:47] INFO "GET /assets/built/screen.css?v=59b1611820" 200 19ms
[2025-01-05 20:39:47] INFO "GET /assets/fonts/inter-roman.woff2?v=59b1611820" 200 13ms
[2025-01-05 20:39:47] INFO "GET /public/cards.min.css?v=59b1611820" 200 22ms
[2025-01-05 20:39:47] INFO "GET /assets/built/source.js?v=59b1611820" 200 21ms
[2025-01-05 20:39:47] INFO "GET /public/cards.min.js?v=59b1611820" 200 7ms
[2025-01-05 20:39:47] INFO "GET /public/member-attribution.min.js?v=59b1611820" 200 7ms
[2025-01-05 20:39:48] INFO "GET /members/api/member/" 204 14ms
[2025-01-05 20:39:48] INFO "GET /favicon.ico" 200 9ms
[2025-01-05 20:39:48] INFO "GET /ghost/api/content/tiers/?key=c7805935787d3f5e628a91c786&limit=all&include=monthly_price,yearly_price,benefits" 200 36ms
[2025-01-05 20:39:48] INFO "GET /ghost/api/content/settings/?key=c7805935787d3f5e628a91c786&limit=all" 200 544ms
[2025-01-05 20:39:48] INFO "GET /ghost/api/content/newsletters/?key=c7805935787d3f5e628a91c786&limit=all" 200 45ms

Builds and starts OK
image

@LaurentGoderre
Copy link
Member

@acburdine from what I understand, the issues are with updating the node version, not the alpine version that node uses. It seems the alpine version was just a timing thing.

@tianon
Copy link
Member

tianon commented Jan 7, 2025

Our ghost-basics test passes: https://github.com/docker-library/ghost/actions/runs/12621753911/job/35173262559?pr=428#step:7:14

So, I'm comfortable with this if you are, @acburdine ❤️

@acburdine
Copy link
Collaborator

it's fine with me, just wanted to make sure there wasn't some build issue with less common arch's 👍🏻

@tianon
Copy link
Member

tianon commented Jan 8, 2025

Let's merge it and find out! 😄

@tianon tianon merged commit 51d8f68 into docker-library:master Jan 8, 2025
3 checks passed
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Jan 8, 2025
Changes:

- docker-library/ghost@51d8f68: Merge pull request docker-library/ghost#428 from locohamster/master
- docker-library/ghost@ecd5118: Merge pull request docker-library/ghost#1 from locohamster/update-to-alpine3.21
- docker-library/ghost@53b2329: Update Dockerfile base image alpine3.20->alpine3.21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants