cog icon indicating copy to clipboard operation
cog copied to clipboard

Document `.dockerignore`

Open bfirsh opened this issue 4 years ago • 4 comments
trafficstars

At the moment we don't mention that you can use .dockerignore files to exclude files from the Cog-built Docker image. We should document that feature.

(edited by @bfirsh and @andreasjansson)

bfirsh avatar Aug 18 '21 22:08 bfirsh

@charlesfrye mentioned this the other day.

bfirsh avatar May 07 '22 01:05 bfirsh

Would it be unwise to have cog init create a .dockerignore file for the user? It could contain popular editor folders, maybe some commented out examples like

# Avoid pushing the user's IDE settings.
.vscode/
.idea/

# Prevent accidental key push.
# id_rsa*
# credentials.txt
# .env
# source_credentials.sh

# Prevent .venv push to slim image, as cog uses a different interpreter anyways. 
# .venv/

# Prevent any test outputs created from being in the image.
# outputs/
# predictions/

afiaka87 avatar May 13 '22 05:05 afiaka87

Great idea.

bfirsh avatar May 13 '22 14:05 bfirsh

Reopening to track writing something down in addition to adding it to cog init template.

mattt avatar Jul 05 '23 16:07 mattt