Tag: makefile

当使用docker-compose -d时,Makefile挂起,代码129失败,不带-d

作为参考,我的规则是这样的: aRule: docker-compose exec -d service /bin/bash -c "/path/to/drush -y drush-commmand" 在Ubuntu 16.04和14.04上,如果我在Makefile规则中运行诸如docker-compose exec -d service /bin/bash -c "/path/to/drush -y drush-commmand ,则Makefile会挂起,然后由于Docker容器中的MemoryError。然而,这个命令在centos和docker-machine都可以使用。 我尝试用docker-compose exec service /bin/bash -c "path/to/drush -y drush-command (没有-d标志)replace命令,这次drush命令成功了,但是Makefile失败并报错代码129 。 然后我尝试用修改后的命令docker-compose exec service /bin/bash -c "path/to/drush -y drush-command 1>/dev/null"来纠正问题,一点点黑客 什么是这样做的正确方法,为什么我会得到上述错误?

就像Docker的“make”一样

我正在添加将我的应用程序封装在docker容器中,这导致我经常input一些非常冗长的命令: sudo docker build -t foo/bar . sudo docker run foo/bar /bin/bash /path/to/my/script/test_report.sh … 我想用某种方式把它们包装在一个脚本中,使它们更容易执行,并让我忘记运行之间的细节。 Make做得很好。 说明可以包装在一起,所以我可以做make test , make run , make deploy或其他。 我认为没有什么能够阻止我使用make,但是有没有更现代的解决scheme,当我使用空格而不是制表符时,它不会中断,而是更愉快的工作? 我的项目是Python,但我正在寻找一个通用的解决scheme。 最好是让我包装bash脚本(因为这使我有无限的灵活性)

使用Makefile获取最新的git标签

我有一个我用来build立我的docker形象的Makefile。 NAME = demo/docker-test default: build build: docker build -t $(NAME) . push: docker push $(NAME) 我想追加到我的Git标签,即build最新版本 build: docker build -t $(NAME):$(VERSION) . 所以如果我在Git v.1.2有3个标签, v.1.3 , v.1.4 VERSION就是v.1.4 。 这可能在一个Makefile? 如果是的话,我从哪里开始呢?

获取刚build好的图像的ID

我有一个运行docker build -t $REPOSITORY:$VERSION .的Makefile docker build -t $REPOSITORY:$VERSION . – 这工作正常。 现在我想自动添加latest标签到build成的图像。 这个命令是: docker tag $IMAGE_ID latest 如何以编程方式获取图像ID,即我刚刚构build的图像的ID?

Makefile – 追加到命令

我正在为我的Docker应用程序编写一个Makefile。 我已经make start-image ,它使用默认命令启动图像: start-image: docker run name 我想有另一个命令make do_something将追加应该在docker容器中运行的命令: do_something: docker run name command args 我如何使用start-image命令来做到这一点?

make :错误1(忽略)

我一直在试图安装domjudgedocker容器,但是当我执行 sudo make install-domserver 我不断收到这个错误: /usr/bin/install -c -m 0644 -o -m 0700 -d /home/domjudge/domjudge/domserver/log /usr/bin/install: invalid user '-m' Makefile:98: recipe for target 'install-domserver-l' failed 您可以在这里看到完整的日志: docker run -it -p 8080:80 a596a9e71faf domjudge@f31ab58ea764:~/domjudge-5.0.1$ ./configure –prefix=$HOME/domjudge checking whether configure should try to set CFLAGS… yes checking whether configure should try to set CXXFLAGS… yes checking whether configure […]

“dockerfile”文本文件忙

我想从dockerfile创build一个项目。 首先,我应该从github克隆一个框架并安装它。 在我的Dockerfile我有以下的提示: RUN git clone https://github.com/simgrid/project.git WORKDIR "/project" RUN cmake option1 options2 . RUN sudo make RUN sudo make install 我用以下方式构build图像 docker build -t "myimage" . 但我有一个关于text file busy的错误。 我怎么能克服它? make[2]: execvp: /simgrid/tools/sg_unit_extractor.pl: Text file busy make[2]: *** [src/cunit_unit.cpp] Error 127 CMakeFiles/testall.dir/build.make:69: recipe for target 'src/cunit_unit.cpp' failed CMakeFiles/Makefile2:616: recipe for target 'CMakeFiles/testall.dir/all' failed make[1]: […]

使用Dockerfile和centos:7映像找不到

我有一个非常基本的Dockerfile,它使用FROM centos:7 ,然后下载Python-2.7.9.tar.xz ,并尝试./configure && make && make altinstall 。 make后出现以下错误: creating Makefile /bin/sh: make: command not found The command '/bin/sh -c cd /root/Python-2.7.9 && ./configure — prefix=/usr/local && make && make altinstall' returned a non-zero code: 127 在运行make之前,我已经安装了下列库 yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel xz-libs gcc g++ build-essential kernel-headers kernel-devel 但错误仍然存​​在。 我该如何解决这个问题?

Docker与Make:构buildDockerfile上的图像变化

我和Docker一起玩,并制作实用程序,并尝试编写仅在Dockerfile更改时重新创buildDocker镜像的规则。 我的项目结构如下所示: tree . . ├── Dockerfile ├── Makefile └── project └── 1.js 我的Dockerfile非常简单: FROM ubuntu RUN apt-get update RUN apt-get install -y curl RUN curl -sL https://deb.nodesource.com/setup | sudo bash – RUN apt-get update RUN apt-get install -y build-essential nodejs VOLUME ["/project"] ENTRYPOINT ["cat"] CMD ["project/1.js"] 它只是使用nodejs安装创build简单的ubuntu镜像,并从共享目录运行脚本。 现在我想从Makefile运行这个图像。 当我更改Dockerfile时,我想重build图像。 Makefile看起来像: default: run run: build […]

如何编译在Docker中使用内核函数的C代码并在容器中使用pci设备?

我有一个Makefile使用PCI设备的一些C ++代码 all: g++ -o executable main.cpp dragon.pb.cc -std=c++11 -O3 -I/usr/include/postgresql -I/usr/include/hiredis -lzmq -lprotobuf -lpthread -lpq -lhiredis clean: rm executable 它依赖于这个使用内核函数的C库。 这个libraby的Makefile是 # dist and build are folders, not phony targets .PHONY: all package clean all: dragon.pb.cc dragon_pb2.py package dragon.pb.cc: dragon.proto protoc –cpp_out=. dragon.proto dragon_pb2.py: dragon.proto protoc –python_out=. dragon.proto package: build clean: rm -f dragon.pb.* […]