TestSpace / Dockerfile
ManiAz09's picture
Update Dockerfile
8fd5ce8 verified
raw
history blame contribute delete
No virus
493 Bytes
FROM python:3.10
# Generate the timestamp and store it in a file
RUN echo $(date +%s) > /timestamp.txt
# Set an environment variable to the timestamp value
ENV TIMESTAMP_FILE=/timestamp.txt
# Use a custom entrypoint or command to load the timestamp into an environment variable
ENTRYPOINT ["/bin/sh", "-c", "export TIMESTAMP=$(cat $TIMESTAMP_FILE) && exec \"$@\"", "--"]
# Example command to show how to use it
CMD ["python", "-c", "import os; print('Timestamp:', os.getenv('TIMESTAMP'))"]