[Bug]: lsio image undercounts directories in mountpoint
- Dominant language
- Swift
- Stars
- 49.9k
- Forks
- 1.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 22
Description
### I have done the following
- [x] I have searched the existing issues
- [ ] If possible, I've reproduced the issue using the 'main' branch of this project
### Steps to reproduce
1. Create a Dockerfile with the following contents:
```
FROM ghcr.io/linuxserver/baseimage-alpine:3.23
CMD ["sh", "-c", "find /mountpoint -mindepth 1 -maxdepth 1 -type d | wc -l"]
```
2. Connect your mac to a SMB/CIFs share with more than 300+ sub-directories.
3. Build your container: `container build --arch arm64 -t repro-lsio-amd64 -f Dockerfile .`
- Both the amd64 and arm64 images have the same issue.
5. Run your container `container run -a amd64 --rm --mount source=/Volumes/Volume/{MountPoint},target=/mountpoint repro-lsio-amd64`
6. Note the number of sub-directories in the mount point:
```
s6-linux-init: warning: parent wrote to fd 3!
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────
_____ __ __ _____ _____ _____ _____
| | | | __|_ _| | |
| --| | |__ | | | | | | | | |
|_____|_____|_____| |_| |_____|_|_|_|
_____ __ __ _ __ ____
| __ | | | | | | \
| __ -| | | | |__| | |
|_____|_____|_|_____|____/
Based on images from linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID: 911
User GID: 911
───────────────────────────────────────
[custom-init] No custom files found, skipping...
[ls.io-init] done.
159
```
6. Validate the count:
```
find /Volumes/Volume/{MountPoint} -mindepth 1 -maxdepth 1 -type d | wc -l
492
```
### Problem description
This is a _much_ more narrowly scoped version of https://github.com/apple/container/issues/678
I have validated that the issue described in issue#678 is no longer present in the normal (dockerhub) "ubuntu:26.04" and "alpine:3.23" images, however the issue does seem to still be present in the linuxserver image which is the base for the image I am trying to consume.
Side note - the issue also appears present when creating the container using docker v4.77.0
### Environment
```markdown
- OS: macOS 27.0 (developer beta)
- Xcode: Not installed for this user
- Container: CLI version 1.0.0 (build: release, commit: ee848e3)
sw_vers
ProductName: macOS
ProductVersion: 27.0
BuildVersion: 26A5353q
uname -m
arm64
mount | grep -i smbfs
//{DOMAIN};{DOMAIN USERNAME}@{IP ADDRESS}/Volume on /Volumes/Volume (smbfs, nodev, nosuid, quarantine, mounted by {username})
Mount info:
smbutil statshares -a
==================================================================================================
SHARE ATTRIBUTE TYPE VALUE
==================================================================================================
Volume
SERVER_NAME {IP ADDRESS}
USER_ID 501
SMB_NEGOTIATE SMBV_NEG_SMB1_ENABLED
SMB_NEGOTIATE SMBV_NEG_SMB2_ENABLED
SMB_NEGOTIATE SMBV_NEG_SMB3_ENABLED
SMB_VERSION SMB_3.1.1
SMB_ENCRYPT_ALGORITHMS AES_128_CCM_ENABLED
SMB_ENCRYPT_ALGORITHMS AES_128_GCM_ENABLED
SMB_ENCRYPT_ALGORITHMS AES_256_CCM_ENABLED
SMB_ENCRYPT_ALGORITHMS AES_256_GCM_ENABLED
SMB_CURR_ENCRYPT_ALGORITHM OFF
SMB_SIGN_ALGORITHMS AES_128_CMAC_ENABLED
SMB_SIGN_ALGORITHMS AES_128_GMAC_ENABLED
SMB_CURR_SIGN_ALGORITHM AES_128_GMAC
COMPRESSION_IO_THRESHOLD 4096
COMPRESSION_CHUNK_LEN 262144
COMPRESSION_MAX_FAIL_CNT 5
WRITE_COMPRESSION_CNT 0
WRITE_CNT_LZ77Huff 0
WRITE_CNT_LZ77 0
WRITE_CNT_LZNT1 0
WRITE_CNT_FWD_PATTERN 0
WRITE_CNT_BWD_PATTERN 0
READ_COMPRESSION_CNT 0
READ_CNT_LZ77Huff 0
READ_CNT_LZ77 0
READ_CNT_LZNT1 0
READ_CNT_FWD_PATTERN 0
READ_CNT_BWD_PATTERN 0
SMB_SHARE_TYPE DISK
SIGNING_SUPPORTED TRUE
EXTENDED_SECURITY_SUPPORTED TRUE
UNIX_SUPPORT TRUE
LARGE_FILE_SUPPORTED TRUE
OS_X_SERVER TRUE
FILE_IDS_SUPPORTED TRUE
DFS_SUPPORTED TRUE
MULTI_CREDIT_SUPPORTED TRUE
DFS_SHARE TRUE
SESSION_RECONNECT_TIME 0:0
SESSION_RECONNECT_COUNT 0
--------------------------------------------------------------------------------------------------
```
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Assessment
This issue has not been assessed yet.