ManiAz09 commited on
Commit
8fd5ce8
·
verified ·
1 Parent(s): 13c06c9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -9
Dockerfile CHANGED
@@ -1,14 +1,13 @@
1
  FROM python:3.10
2
 
 
 
3
 
4
- ARG now
 
5
 
 
 
6
 
7
- ENV timestamp=$(date +%s)
8
-
9
- # Ensure the timestamp is available as an environment variable
10
- # ENV BUILD_TIMESTAMP=$timestamp
11
-
12
-
13
- # Print the timestamp to verify
14
- RUN echo "The build timestamp is $timestamp"
 
1
  FROM python:3.10
2
 
3
+ # Generate the timestamp and store it in a file
4
+ RUN echo $(date +%s) > /timestamp.txt
5
 
6
+ # Set an environment variable to the timestamp value
7
+ ENV TIMESTAMP_FILE=/timestamp.txt
8
 
9
+ # Use a custom entrypoint or command to load the timestamp into an environment variable
10
+ ENTRYPOINT ["/bin/sh", "-c", "export TIMESTAMP=$(cat $TIMESTAMP_FILE) && exec \"$@\"", "--"]
11
 
12
+ # Example command to show how to use it
13
+ CMD ["python", "-c", "import os; print('Timestamp:', os.getenv('TIMESTAMP'))"]