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

.dockerignore is not excluding pids, storage directories #49210

Closed
rubys opened this issue Sep 9, 2023 · 0 comments · Fixed by #49211
Closed

.dockerignore is not excluding pids, storage directories #49210

rubys opened this issue Sep 9, 2023 · 0 comments · Fixed by #49211

Comments

@rubys
Copy link
Contributor

rubys commented Sep 9, 2023

Steps to reproduce

rm -rf demo
rails new demo --main
cd demo
touch tmp/pids/server.pid
docker buildx build . -t rails-demo
docker run --rm -i -t rails-demo ls -l tmp/pids

Expected behavior

No server.pid in the container

Actual behavior

server.pid file exists in container

System configuration

Rails version: --main

Ruby version:

ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]

Additional information

The problem was first reported as App deployment getting stuck at pushing image to fly. The problem was determined to be that the storage directory was being uploaded making the image too big. The identified solution was to remove two lines

 # Ignore pidfiles, but keep the directory.
 /tmp/pids/*
-!/tmp/pids/  # <-- bug: This line should be deleted, is basically making the previous line useless, all files inside /tmp/pids are being sent to the context
 !/tmp/pids/.keep

 # Ignore storage (uploaded files in development and any SQLite databases).
 /storage/*
 !/storage/.keep
 /tmp/storage/*
-!/tmp/storage/ # <-- bug: This line should be deleted, is also making the previous line useless, all files inside /tmp/storage are being sent to the context. This directory had 5.5 GB of data in my case.
 !/tmp/storage/.keep
rubys added a commit to rubys/rails that referenced this issue Sep 9, 2023
rubys added a commit to fly-apps/dockerfile-rails that referenced this issue Sep 9, 2023
rubys added a commit to rubys/showcase that referenced this issue Sep 9, 2023
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 a pull request may close this issue.

1 participant