File sharing, permissions and portability
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Treat the worksheet as offline evidence. Before any separately authorized server query, verify the effective endpoint and its trust boundary, including context overrides. Do not change runtime state, mount host data or modify Desktop settings in this exercise.
Synthetic project review:App.py and app.py coexist on case-sensitive sourcestart.sh contains CRLF line endingsentrypoint expects LF and executable permissionSource: editable project filesData: database working directoryTarget: Linux production imageOn a case-insensitive host, two filenames differing only in letter case may collide; do not assume every macOS or Windows volume uses the same policy. A script with CRLF may be misread by a Linux interpreter, particularly its shebang; configure LF for shell scripts and check Git attributes and the built image. Preserve executable intent with version-controlled metadata or an explicit Dockerfile permission step. Shared filesystem mode and ownership may not mirror native Linux behavior. Use a narrowly scoped bind mount for edited source and consider a managed volume for database data rather than crossing the host filesystem boundary for every write. Check watcher events and permissions on each approved target; avoid recursive permission changes. A read-only mount limits writes through that mount but does not make the entire host inaccessible. For the synthetic script, check LF bytes and executable intent in the final image, not just the working copy. A bind mount over the image path can obscure the image’s tested files and permissions. Verify name uniqueness on the actual target filesystem.
Common mistake
Passing tests on a case-insensitive filesystem does not prove imports or paths will work in a case-sensitive Linux image.
Manual practice
Find three portability risks in the fixture and specify a targeted fix and verification for each. Choose storage for source and database separately.
Worksheet: lab-fixtures/docker-desktop-portability/04-file-sharing/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
File sharing, permissions and portability — Knowledge check
Interpret synthetic cross-platform evidence and identify missing compatibility or entitlement checks.
Why can App.py and app.py cause problems?
What line ending is appropriate for a Linux shell script?
Which storage is a reasonable starting point for database working data?