How to enable / setup Dependency Caches for apt-get on BitBucket Pipelines

前端 未结 3 1226
时光说笑
时光说笑 2021-01-01 15:09

I am using the following code in my bitbucket-pipelines.yml files to remotely deply code to a staging server.

image: php:7.1.1

pipelines:
  def         


        
3条回答
  •  臣服心动
    2021-01-01 15:17

    Unfortunately, the parts that take the time are unsafe or pointless to cache. Remember that the pipeline caches may be deleted at any time, so you always need to run the commands anyway.

    apt-get update doesn't use a cache, so will download the latest indexes every time.

    apt-get install caches downloaded packages in /var/cache/apt so you could save that. However this probably won't actually save any time

    Fetched 907 kB in 0s (998 kB/s)

    The actual installed packages cannot be cached, because they a) are spread around multiple shared files and directories and b) may not be portable to different docker images.

    At a deeper level, satisfactory interaction between caching, apt-get update, and Docker is a complex issue.

提交回复
热议问题