dockerfile

Docker hub automated build depend on another docker hub repo

心已入冬 提交于 2021-02-08 15:19:27
问题 I know the procedure and also how to configure an automated docker hub from GitHub or BitBucket. But what I have to do right now is to create two docker hub repositories called Test/main and Test/depend . The first repository Test/main is connected with GitHub and whenever there is a new push the image will be automatically build. But I want to trigger another repository Test/depend whenever there is a change on the Test/main repository. Is it possible to configure such scenario? 回答1: This

Docker hub automated build depend on another docker hub repo

社会主义新天地 提交于 2021-02-08 15:15:14
问题 I know the procedure and also how to configure an automated docker hub from GitHub or BitBucket. But what I have to do right now is to create two docker hub repositories called Test/main and Test/depend . The first repository Test/main is connected with GitHub and whenever there is a new push the image will be automatically build. But I want to trigger another repository Test/depend whenever there is a change on the Test/main repository. Is it possible to configure such scenario? 回答1: This

Stopping Apache2 is much slower when overriding ENTRYPOINT in Docker

こ雲淡風輕ζ 提交于 2021-02-08 10:53:35
问题 I'm containerizing a PHP application and would like to modify the Apache configuration based on environment variables. This is done in a script overriding the default ENTRYPOINT : FROM php:7.2-apache # ... COPY prepare-docker-configs.sh . RUN chmod +x prepare-docker-configs.sh ENTRYPOINT ./prepare-docker-configs.sh After those modifications, Apache doesn't start. apache2-foreground seems to be the missing command, so I run it at the end of prepare-docker-configs.sh #!/bin/bash # ... Some

Stopping Apache2 is much slower when overriding ENTRYPOINT in Docker

末鹿安然 提交于 2021-02-08 10:52:09
问题 I'm containerizing a PHP application and would like to modify the Apache configuration based on environment variables. This is done in a script overriding the default ENTRYPOINT : FROM php:7.2-apache # ... COPY prepare-docker-configs.sh . RUN chmod +x prepare-docker-configs.sh ENTRYPOINT ./prepare-docker-configs.sh After those modifications, Apache doesn't start. apache2-foreground seems to be the missing command, so I run it at the end of prepare-docker-configs.sh #!/bin/bash # ... Some

Conditional ARG in Dockerfile?

心已入冬 提交于 2021-02-08 10:33:50
问题 I'm trying to conditionally install vim in my docker container if I pass an optional ARG - say something like DEVBUILD. I can't find any documentation on how to use something like IF in a Dockerfile. Something like this: FROM node:8 if $DEVBUILD { RUN apt-get update RUN apt-get --assume-yes install vim } Is this possible, and if so, where can find a reference on the syntax? 回答1: Yes, it is possible. When docker builds image it uses standard shell. Dockerfile is: FROM node:8 ARG DEVBUILD RUN

Docker toolbox volumes on windows doesn't refresh changes on container

落爺英雄遲暮 提交于 2021-02-08 07:10:24
问题 I am starting with docker on windows and I am trying to use volumes for manage data in containers. My host environment is a: Windows 8.1 Docker Toolbox 1.8. Virtual Box 5.0.6 I've created a ngnix image using the following Dockerfile. Dockerfile FROM centos:6.6 MAINTAINER afym ENV WEBPORT 80 RUN yum -y update; yum clean all RUN yum -y install epel-release; yum clean all RUN yum -y install nginx; yum clean all RUN echo "daemon off;" >> /etc/nginx/nginx.conf VOLUME /usr/share/nginx/html EXPOSE

Customize ONBUILD environment in a dockerfile

江枫思渺然 提交于 2021-02-08 06:28:12
问题 I am slightly modifying this Dockerfile to support my specific usecase: I need to specify my own PyPi server, where we are publishing our internal libraries. This can normally be achieved by specifying a pip.conf file, or by passing command line options to pip . I am trying with this: FROM python:3.5 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app ONBUILD COPY requirements.txt /usr/src/app/ # 1st try: set the env variable and use it implicitely. Does not work! # ENV PIP_CONFIG_FILE pip.conf #

Using Docker for Windows in Jenkins Declarative Pipeline

你说的曾经没有我的故事 提交于 2021-02-07 21:50:26
问题 I am setting up a CI workflow with Jenkins declarative pipeline and Docker-for-Windows agents through Dockerfile . Note: It is unfortunately currently not a solution to use a Linux-based docker daemon, since I need to run Windows binaries. Setup: Jenkins master runs on Linux 16.04 through Docker. Jenkins build agent is Windows 10 Enterprise 1709 (16299.551) Docker-for-Windows 17.12.0-ce Docker 18.x gave me headaches when trying to use Windows Containers, so I rolled back to 17.x. I still had

Using Docker for Windows in Jenkins Declarative Pipeline

…衆ロ難τιáo~ 提交于 2021-02-07 21:50:18
问题 I am setting up a CI workflow with Jenkins declarative pipeline and Docker-for-Windows agents through Dockerfile . Note: It is unfortunately currently not a solution to use a Linux-based docker daemon, since I need to run Windows binaries. Setup: Jenkins master runs on Linux 16.04 through Docker. Jenkins build agent is Windows 10 Enterprise 1709 (16299.551) Docker-for-Windows 17.12.0-ce Docker 18.x gave me headaches when trying to use Windows Containers, so I rolled back to 17.x. I still had

Catching SIGTERM from alpine image

元气小坏坏 提交于 2021-02-07 20:24:07
问题 I was trying to catch SIGTERM signal from a docker instance (basically when docker stop is called) but couldn't find a way since I have different results for each try I performed. Following is the setup I have Dockerfile FROM gitlab/gitlab-runner:alpine COPY ./start.sh /start.sh ENTRYPOINT ["/start.sh"] start.sh #!/bin/bash deregister_runner() { echo "even if nothing happened, something happened" exit } trap deregister_runner SIGTERM while true; do sleep 10 done Now I build the docker image $