ManiAz09 commited on
Commit
beb1360
·
verified ·
1 Parent(s): 2c7a70b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -1,14 +1,14 @@
1
  FROM python:3.10
2
 
3
 
4
- # RUN apk add --no-cache bash
5
- # +%Y%m%d%H%M%S
6
 
 
 
7
 
8
- # Get the current timestamp and store it in an environment variable
9
- RUN timestamp=$(date +%s) && \
10
- echo "Timestamp: $timestamp" && \
11
- echo "export BUILD_TIMESTAMP=$timestamp" >> /etc/profile
12
 
13
  # Ensure the timestamp is available as an environment variable
14
  ENV BUILD_TIMESTAMP=$timestamp
 
1
  FROM python:3.10
2
 
3
 
4
+ # Define a build argument for the timestamp
5
+ ARG BUILD_TIMESTAMP
6
 
7
+ # Set the environment variable using the build argument
8
+ ENV BUILD_TIMESTAMP=${BUILD_TIMESTAMP}
9
 
10
+ # Use the timestamp in a command (for demonstration)
11
+ RUN echo "Build timestamp: ${BUILD_TIMESTAMP}"
 
 
12
 
13
  # Ensure the timestamp is available as an environment variable
14
  ENV BUILD_TIMESTAMP=$timestamp