Skip to content

Instantly share code, notes, and snippets.

@pokutuna
Last active August 16, 2020 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pokutuna/e181f8e9e20a49e7cc6c46c75bd07a82 to your computer and use it in GitHub Desktop.
Save pokutuna/e181f8e9e20a49e7cc6c46c75bd07a82 to your computer and use it in GitHub Desktop.
version: '3.8'
services:
app:
build:
context: .
FROM alpine:3.12.0
RUN mkdir /app
COPY print.sh /app
ENV PATH /app:$PATH
ENTRYPOINT ["print.sh"]
#!/bin/sh
echo "Hello, ${@}!"
#!/bin/sh
echo '--- docker build ---'
docker build -t can-i-use-cache:latest .
# --- docker build ---
# Sending build context to Docker daemon 5.12kB
# Step 1/5 : FROM alpine:3.12.0
# ---> a24bb4013296
# Step 2/5 : RUN mkdir /app
# ---> Running in c1f982e10c52
# Removing intermediate container c1f982e10c52
# ---> 2fe579ed6f0f
# Step 3/5 : COPY print.sh /app
# ---> b79d2046076a
# Step 4/5 : ENV PATH /app:$PATH
# ---> Running in 986c29c55213
# Removing intermediate container 986c29c55213
# ---> ad9ff528f463
# Step 5/5 : ENTRYPOINT ["print.sh"]
# ---> Running in 263b7aed0711
# Removing intermediate container 263b7aed0711
# ---> cf15b116dd1c
# Successfully built cf15b116dd1c
# Successfully tagged can-i-use-cache:latest
echo '--- docker-compose build ---'
docker-compose build
# --- docker-compose build ---
# Building app
# Step 1/5 : FROM alpine:3.12.0
# ---> a24bb4013296
# Step 2/5 : RUN mkdir /app
# ---> Using cache
# ---> 2fe579ed6f0f
# Step 3/5 : COPY print.sh /app
# ---> a787e9b6de30
# Step 4/5 : ENV PATH /app:$PATH
# ---> Running in 3d069fd24b3e
# Removing intermediate container 3d069fd24b3e
# ---> 99848159747d
# Step 5/5 : ENTRYPOINT ["print.sh"]
# ---> Running in e963aa1251e0
# Removing intermediate container e963aa1251e0
# ---> 2fb18b36813a
#
# Successfully built 2fb18b36813a
# Successfully tagged 20200817plqosg_app:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment