Tag: docker

设置一个docker MS构build服务器映像

我需要一个用于创build.NET构build服务器映像的Dockerfile的工作示例。 无论我安装什么,当尝试使用容器构build我的项目时,出现以下错误: 错误MSB3644:未find框架“.NETFramework,版本= v4.5.2”的引用程序集。 要解决此问题,请为此框架版本安装SDK或定位包,或者将您的应用程序redirect到您安装了SDK或定位包的框架版本。 请注意,程序集将从全局程序集caching(GAC)中parsing出来,并将用于代替引用程序集。 因此,您的程序集可能无法正确定位您想要的框架。 我目前的Dockerfile看起来像这样: # escape=` FROM microsoft/dotnet-framework:4.6.2 MAINTAINER xxx@xxx.com SHELL ["powershell"] RUN New-Item -ItemType directory -Path "C:\tools" WORKDIR C:\tools\ RUN Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?linkid=845298" -OutFile "winsdksetup.exe" -UseBasicParsing RUN .\winsdksetup.exe /q /norestart # Note: Install .Net 4.5.2 RUN Invoke-WebRequest -Uri "https://download.microsoft.com/download/E/2/1/E21644B5-2DF2-47C2-91BD-63C560427900/NDP452-KB2901907-x86-x64-AllOS-ENU.exe" -OutFile "NDP452-KB2901907-x86-x64-AllOS-ENU.exe" -UseBasicParsing RUN .\NDP452-KB2901907-x86-x64-AllOS-ENU.exe /q /norestart # Note: Install .Net […]

在Docker中运行Angular2应用程序

我试图在docker中运行我的ng2应用程序。 我有Docker文件: FROM ubuntu:latest RUN apt-get update #Install curl & git RUN apt-get -qq -y install curl RUN apt-get install -yqq git #Download and install nodejs-6 RUN curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh RUN bash nodesource_setup.sh RUN apt-get install -yqq nodejs RUN apt-get install -yqq build-essential RUN npm install -g angular-cli #Clone the project RUN git […]

是否有相当于Docker Hub私有存储库的GitHub部署密钥?

我正在尝试使用Docker Hub专用存储库将映像部署到几台生产服务器。 我想完成这个任务,而不是在服务器上存储我的Docker Hub凭证(最好避免设置一个专门的部署用户)。 GitHub的部署密钥在概念上有没有什么区别?

使用-f选项的Docker构build不能findDockerfile

我已经尝试了很多与docker -f选项的组合,但我从来没有得到它的工作 我可以做这个: docker build -t foo/bar . 但我不能这样做: docker build -t foo/bar -f Dockerfile . 或这个: docker build -t foo/bar -f ./Dockerfile . 这给了我以下错误: unable to prepare context: The Dockerfile (c:\path\Dockerfile) must be within the build context (.) 我在Windows 7上通过默认的vm使用docker。Docker版本是1.8.1,build d12ea79 我看不出有什么不同。 在项目中为不同的任务设置不同的Docker文件可能是非常好的,但是没有-f选项是不可能的。

Docker轨道迁移

我试图让docker和fig运行我的rails应用程序,它也包含redis服务器,mongodb,postgres和nginx,下面是我的fig.yml的样子: pg: image: docker-index.my.com/postgres ports: – 5432 redis: image: docker-index.my.com/redis ports: – 6379 mongodb: image: docker-index.my.com/mongodb ports: – 27017 app: build: . command: bundle exec rails s volumes: – .:/beesor ports: – 3000:3000 links: – pg – redis – mongodb environment: RAILS_ENV: production 一切工作正常,直到启动应用程序的时刻,因为轨道初始化器钩在服务器启动,然后我得到有关数据库连接的错误,数据库不存在! 当然,因为它没有在Dockerfile上创build(见下文) Dockerfile内容: # DOCKER-VERSION 0.10.0 FROM docker-index.my.com/ruby:1.9.3 MAINTAINER my.com RUN apt-get […]

Dockerfile不在RUN作曲者安装命令中使用caching

我以为我已经了解了Docker,但是今天我发现了一些关于使用dockercaching的问题。 这是我的dockerfile FROM quay.io/my_company/phpjenkins WORKDIR /usr/src/my_project ADD composer.json composer.json ADD composer.lock composer.lock RUN composer install -o ADD . . RUN mkdir -p temp/unittest/cache log RUN cp app/config/config.unittest.template.neon app/config/config.unittest.neon CMD ["tail", "-f", "/dev/null"] 我希望docker使用caching,直到ADD . . ADD . . 但是,每一个构build,看起来像docker试图每次做composer install 。 这是一些输出 + docker-compose -f docker-compose.yml run app vendor/bin/phpunit -d memory_limit=2048M Creating network "xxx_default" with […]

Jenkins Docker容器无法访问docker.sock

我用docker-compose和这个configuration部署了标准的Jenkins Docker镜像: deployer: image: jenkins volumes: – "/mnt/jenkins:/var/jenkins_home" – "/var/run/docker.sock:/var/run/docker.sock" ports: – "2375:2375" – "8080:8080" – "50000:50000" 在阅读了大量的SO问题后,我testing了使用gpasswd -a ${USER} docker docker exec jenkins_deployer echo ${USER}将Root添加到docker用户组,并validationContainer中的用户是root用docker exec jenkins_deployer echo ${USER} 。 当我尝试添加Docker访问里面的“Docker URL = unix:///var/run/docker.sock”时,我得到错误消息“ org.newsclub.net.unix.AFUNIXSocketException:权限被拒绝(套接字: /run/docker.sock) “ 我怎样才能让jenkins访问docker.sock来自动部署Docker容器?

由于活性问题或因停止请求而导致的容器重启之间的区别

我正在与Kubernetes ,一个吊舱由不同的容器组成。 当两个特定事件发生时,我需要应用不同的行为: 一个容器(无论什么原因)都有问题,需要重新启动。 当活性探测失败时会发生这种情况 计划停止一个吊舱。 例如,我推出了一个新版本,kubernetes终止了前一个版本,并启动了新版本 根据我在两种情况下所理解的情况,kubernetes调用preStop钩子并发送一个SIGTERM ,所以我不可能了解两种情况中的哪一种。 是对的吗? 我错过了什么吗? 谢谢

如何使用KiteMatic接口将Docker卷展示给本地机器

在我的Mac上玩TensorFlow,我使用KiteMatic运行“temsorflow:latest”docker。 我有一些我想在本地机器上运行的Python示例。 基本上我想能够import tensorflow as tf ,但由于这个库存在我的docker我需要以某种方式公开这个文件夹。 根据KiteMatic文件 : Kitematic在~/Kitematic/<container's name>/下暴露容器的体积数据~/Kitematic/<container's name>/ 但我在那里看不到 我错过了什么?

无法使用(spotify)Docker maven插件推送到远程repo

我有一个Spring Boot项目,我想从Docker的私有registry中build立一个映像。 我遵循Spring Boot官方文档 ,使用Spotify Docker Maven插件 。 使用Boot2Docker将我的映像发布到Docker本地实例时运行良好。 现在我正在试图做一个远程的私人回购(一个不安全的回购),我正在努力。 我已经按照这个插件的文档,这就是我的configuration如下所示: <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.4.9</version> <configuration> <imageName>service-discovery</imageName> <dockerDirectory>src/main/docker</dockerDirectory> <resources> <resource> <targetPath>/</targetPath> <directory>${project.build.directory}</directory> <include>${project.build.finalName}.war</include> </resource> </resources> </configuration> <executions> <execution> <id>build-image</id> <phase>package</phase> <goals> <goal>build</goal> </goals> </execution> <execution> <id>tag-image</id> <phase>package</phase> <goals> <goal>tag</goal> </goals> <configuration> <image>service-discovery</image> <newName>develop01.mycompany.com:5000/service-discovery</newName> </configuration> </execution> </executions> </plugin> </plugins> </build> […]