Comments (8)
Just use TZ. It's meant to be there (POSIX standard). /etc/localtime is a GNU extension that makes things faster if it's there.
from sel4-camkes-l4v-dockerfiles.
It does appear that passing the time zone via TZ as an environment variable is more stable than trying to link the time zone file directly.
The main question is how to reliably get the time zone string from the host OS. On reasonably recent Debian, Ubuntu, and MacOS at least, the /etc/localtime
link seems to always exist, so we could try to extract it from that.
Ubuntu and Debian both seem to support reading /etc/timezone
which for me both report the correct string Australia/Sydney
. I think Debian also sets TZ
. So we could do the following in decreasing priority
- check
TZ
env, if set use that - check
/etc/timezone
, if the file exists use its contents - check for MacOS, if yes, strip
/var/db/timezone/zoneinfo/
from the link in/etc/localtime
- otherwise print a warning that time zone is not set
from sel4-camkes-l4v-dockerfiles.
We could also delete the symlink in the container, of course. Not sure if that throws anything into disarray.
from sel4-camkes-l4v-dockerfiles.
TZ is unfortunately not set on most platforms I tried (in fact, it was set only on Debian). It works when I set it in the container, but my main problem is trying to get the correct time zone string from the host.
from sel4-camkes-l4v-dockerfiles.
Yes, adding MacOS support was a real spanner in the works, unfortunately :(
What does the /usr/share/zoneinfo.default/Australia/Sydney
file (or folder) look like on the host?
Otherwise, your bullet point list of options sounds fair enough.
from sel4-camkes-l4v-dockerfiles.
For the timezone file itself I get the following on MacOS:
ls -l /usr/share/zoneinfo.default/Australia/Sydney
-rw-r--r-- 4 root wheel 2195 28 Oct 19:43 /usr/share/zoneinfo.default/Australia/Sydney
Before I try all that extraction stuff, I'll give it the old method another shot by deleting the symbolic link in the docker container so that there is no conflict when docker is trying to mount there. Peter mentioned that if the file/link does not exist it's just going to default to UTC which is what it's already doing anyway, so there should be no additional adverse effects if the mount command doesn't work for some reason.
from sel4-camkes-l4v-dockerfiles.
Hi all, also run into the wall of getting the docker image up and running on an M1 Mac, I've set the environment var export DOCKER_BUILDKIT=0
(ran into the same issue as #40 , when pulling extras
image), but I believe I have arrived at the same issue as this one describes:
When running make user
, fails at:
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/usr/share/zoneinfo.default/Europe/London" to rootfs at "/etc/localtime": mount /usr/share/zoneinfo.default/Europe/London:/etc/localtime (via /proc/self/fd/9), flags: 0x5001: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
make: *** [Makefile:131: user_run] Error 125```
from sel4-camkes-l4v-dockerfiles.
Related Issues (20)
- Recent docker on MacOS does not allow mounting of /etc/localtime HOT 4
- MacOS date command has different arguments and breaks docker image age checking HOT 5
- Issues building images, due to apt error HOT 1
- make user doesn't work on mac HOT 3
- Docker option :exec not accepted by docker. HOT 2
- make user does not work HOT 5
- `make user` fails with `docker: Error response from daemon: Unable to find group stack.` on MacOS HOT 1
- Is the stack group required for a regular build environment? HOT 6
- Investigate if linter can be PR scoped HOT 1
- make user failed on MacBook Pro with Apple M1 chipset HOT 46
- Freeze Python package dependencies (camkes-deps currently breaks) HOT 2
- Clarification on pull request #42
- delete merged branches "spdx" and "fix_os" HOT 1
- Update Haskell toolchain in containers HOT 5
- Do not run Authenticate and Push on forks HOT 1
- Update QEMU to 7.0 as is enforces stronger RISC-V spec compliance HOT 6
- review bash invocations in this repo
- deploy action is running out of disk space HOT 1
- remove cogent HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sel4-camkes-l4v-dockerfiles.