简体   繁体   English

错误的 docker 图片在 Github Actions

[英]Wrong docker image on Github Actions

I'm building CI/CD on Github Actions, and I want to use a specific docker image.我在 Github Actions 上构建 CI/CD,我想使用特定的 docker 图像。

I used this yaml file:我使用了这个 yaml 文件:

jobs:
  build:
    name: Test Image
    runs-on: ubuntu-latest
    container:
      image: lambci/lambda:build-nodejs12.x
    steps:
      - name: What OS is running
        run: uname -a

But I'm getting the wrong image:但是我得到了错误的图像:

Linux b25c9fe8c287 5.4.0-1031-azure #32~18.04.1-Ubuntu SMP Tue Oct 6 10:03:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

instead of代替

Linux 758d8f59b7b6 5.4.39-linuxkit #1 SMP Fri May 8 23:03:06 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux).

What am I doing wrong?我究竟做错了什么?

The output of uname -a shows you what kernel is running. uname -a的 output 显示了 kernel 正在运行的内容。 There are no kernels shipped with docker images, instead you get the Linux kernel of the host. docker 图像没有附带内核,而是您获得主机的 Linux kernel。 Docker is a method to run isolated processes, not a virtual machine environment, and therefore you should expect the output of uname -a to vary depending on where you run the image. Docker 是一种运行隔离进程的方法,而不是虚拟机环境,因此您应该期望uname -a的 output 根据运行图像的位置而有所不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM