Questions tagged [dockerfile]

1

votes
1

answer
2.5k

Views

Create a dockerfile that runs a python http server to display an html file

I have a directory with one simple HTML file (name: index.html) which displays some basic text. I run the python command: python -m SimpleHTTPServer 7000 to run a server, at port 7000, in the same directory to display the page in a browser. Now I want to be able to dockerize this process and need...
El Tikki
1

votes
3

answer
231

Views

docker build is failing when snowflake dependency is included in the pip requirements

I am trying to build docker image out of my python application. But when I am adding 'snowflake-connector-python' to the pip requirements.txt file the docker build is failing. requirements.txt:- boto3 pycryptodome snowflake-connector-python Dockerfile:- FROM python:alpine3.6 RUN python --version CO...
dks551
1

votes
3

answer
495

Views

How can I upgrade pip inside a venv inside a Dockerfile?

While running $ sudo docker build -t myproj:tag . I am hit with the message You are using pip version 10.0.1, however version 18.0 is available. You should consider upgrading via the 'pip install --upgrade pip' command. and given recent occasional subtleties manifesting themselves with the error: '/...
Calaf
1

votes
1

answer
219

Views

How to copy a csproj file using docker without visual studio and without docker compose?

I just started a new solution with a .NET Core Project (2.1) using visual studio 15.8.8. It can run and debug it by setting the docker compose file as a startup project. It works! Logically, I should be able to build the docker image with a simple commandline statement. However, it complains that th...
Daan
1

votes
2

answer
394

Views

Netstat not showing ports exposed by docker

For some reason netstat is not listing ports exposed by docker. As suggested here I usedEXPOSE for both ports 8080 and 5050. But none of them is visible from host. Dockerfile ... FROM openjdk:11-jre-slim COPY --from=build /usr/src/app/api/target/track-metadata-api-*.jar /app/track-metadata-api.jar...
Matjaž Mav
1

votes
1

answer
412

Views

pip search finds tensorflow, but pip install does not

I am trying to build a Django app that would use Keras models to make recommendations. Right now I'm trying to use one custom container that would hold both Django and Keras. Here's the Dockerfile I've written. # myproject/docker/app/Dockerfile FROM python:3.7-alpine # I've tried 3.5, 3.6 and 3.7 R...
julka
1

votes
1

answer
35

Views

Can I create a temporary variable in Dockerfile and reuse it later?

In my Dockerfile, I want to temporarily switch to root and then switch back to the original user. originalUser=`RUN whoami` USER root RUN apk update RUN apk add curl # switch back to the user before root USER $originalUser Is it possible to do something like this in Dockerfile?
user674669
0

votes
1

answer
23

Views

Simple Docker container dies immediatelly after docker run command

I have a Dockerfile which looks like this: FROM alpine:3.9 RUN apk add --update openjdk8 RUN mkdir /var/generator/ COPY generator.jar /var/generator EXPOSE 8080 ENTRYPOINT [ '/bin/sh' ] Dockerfile is inside generator/ folder. I am building it using: docker build -t generator generator/ It builds suc...
dziki
1

votes
2

answer
1.2k

Views

No EXPOSE in aws docker fails deployment

I have a scrapy project run continously by cron hosted inside a docker image. When I run and deploy this locally everything works fine. If I try to deploy the same to AWS I get the following error inside the logs: No EXPOSE directive found in Dockerfile, abort deployment (ElasticBeanstalk::ExternalI...
lony
1

votes
1

answer
1.9k

Views

Docker RUN Command

I'm confused about this following passage in the article about Docker's CMD vs. RUN vs. ENTRYPOINT. Note that apt-get update and apt-get install are executed in a single RUN instruction. This is done to make sure that the latest packages will be installed. If apt-get install were in a separate RUN i...
qarthandso
1

votes
3

answer
1.6k

Views

“Value cannot be null. Parameter name: userName” error when installing MSSQL 2014 Express in Docker

When I try installing MSSQL 2014 Express in Dockerfile, it fails with error 'Value cannot be null. Parameter name: userName'. The following error occurred: Value cannot be null. Parameter name: userName Error result: -2147467261 Result facility code: 0 Result error code: 16387 Please review the summ...
Samuel
1

votes
2

answer
892

Views

How to inject Docker container build timestamp in container?

I would like to build a container which shows up in its startup log its build datetime. Is there a way to have that information injected from my build machine into the container ?
Riduidel
1

votes
2

answer
244

Views

Multi-stage Dockerfile: ARG before FROM not substituted

I'm writing a multi-stage Dockerfile for the darshan utils: ARG DARSHAN_VER=3.1.6 FROM fedora:29 as build RUN dnf install -y \ gcc \ make \ bzip2 bzip2-devel zlib zlib-devel RUN curl -O 'ftp://ftp.mcs.anl.gov/pub/darshan/releases/darshan-${DARSHAN_VER}.tar.gz' \ && tar ... FROM fedora:29 COPY --from...
Alberto Chiusole
1

votes
1

answer
62

Views

How to mount volume from host to container

I am using docker in windows 10 and want to output logs from docker container to host D:/Test. This is my log configuration: public class HomeController : Controller { private readonly ILogger _logger; public HomeController(ILogger logger) { _logger = logger; } public IActionResult Index() {...
Tao Zhou
1

votes
2

answer
75

Views

What is “/app” working directory for a Dockerfile?

In the docker docs getting started tutorial part 2, it has one make a Dockerfile. It instructs to add the following lines: # Set the working directory to /app WORKDIR /app # Copy the current directory contents into the container at /app COPY . /app What is /app, and why is this a necessary step?
1

votes
2

answer
65

Views

Rails assets:precompile is using wrong bundler version

I recently updated my dockerized rails app (5.0 -> 5.2) and am now using Bundler 2. I've added RUN gem install bundler to my Dockerfile to ensure I have Bundler 2 installed. My RUN bundle install step runs fine, but when I get to the asset precompile step it seems to start using Bundler 1 again: Ste...
Deekor
1

votes
1

answer
94

Views

Docker - Import Json Docment Inside The Solr Core

I want to ask if there is a way to import Json document into the core from the docker file while creating the core, or if I can mount a pre-created core directory with the Json file already imported inside it. An another method than import the document from Solr server page in Documents core tab and...
Ebraheem Alrabee'
1

votes
0

answer
191

Views

Docker Compose file to Docker Stack

I have found an awesome repo that uses docker-compose however I would like to use it Docker Cloud Stacks (I am a newbie). What would I have to do to be able to swap it over? docker-compose: version: '2' services: mariadb: image: wodby/mariadb:10.2-3.0.2 php: # 1. Images with vanilla WordPress – wo...
Jess McKenzie
1

votes
1

answer
432

Views

Shared build logic with docker-compose and multi-stage Dockerfiles

I am using docker-compose with multi-stage Dockerfiles to build and run multiple services. This works, but the 'build' portion of each multi-stage build is largely copy-and-pasted between each service's Dockerfile. I want to reduce the copy-and-paste / centralize the common build logic in one spot....
LegNeato
1

votes
2

answer
877

Views

How to add known_hosts for passwordless ssh within docker container in docker-compse.yml?

I want to have passwordless ssh within two docker containers. How to add known_hosts entry for that using docker-compose.yml file I want to implement ansible on docker env. To deploy and run rpm on deployment node, I need passwordless ssh from container1 to container2. For that I have to add known_h...
user2664210
1

votes
0

answer
19

Views

There are two dockerfiles that I'm pulling, how do I stop the second docker file without affecting the other one?

I'm really sorry but I am completely new to docker.. so I had an error network and I tried pulling again because I thought the first one stop. And this happened.. How do you stop the second docker file without affecting the first one??
Alianne
1

votes
0

answer
416

Views

How to specify build options for docker-compose build stage?

I have a main docker-compose.yml: version: '3' services: recognizer: container_name: recognizer build: ./recognizer hostname: recognizer restart: always ports: - 8084:8084 network_mode: 'host' I have a folder recognizer with Dockerfile and docker-compose.yml: Dockerfile: FROM openjdk:8 RUN mkd...
Denis
1

votes
2

answer
81

Views

command option gets ignored in docker-compose.yaml

These are the contents of my docker-compose.yaml. rabbitmq: image: docker_rabbitmq hostname: rabbitmq restart: always ports: - '5672:5672' elasticsearch: image: docker_elasticsearch hostname: elasticsearch restart: always ui-console: image: docker-ui-console hostname: ui-console restart: always port...
user2010672
1

votes
0

answer
435

Views

Selenium WebDriver - Process unexpectedly closed

I have built a Docker image on top of Node to execute a bunch of Selenium tests. Here is my Dockerfile: #Dockerfile for individual node instance FROM node:latest #add the .js Selenium testcase files COPY ./tests /tests #add geckodriver (latest version) from local directory COPY geckodriver-v0.1...
wallnfl
1

votes
0

answer
465

Views

Get Environment variable from .env file and pass to Dockerfile

This seems like a huge oversight on the developers behalf as I can't understand the use case where you don't want the image build to know about .env variables. I'm running Laravel and I'm access some AWS keys from with a .env file. When I try to build an image via a Dockerfile, the php compsoer auto...
MattBoothDev
1

votes
0

answer
682

Views

ERROR: unsatisfiable constraints: while installing package in alpine

I am trying to build a docker image based on Alpine and I need to install few packages in it. Here is exactly what I am trying to do: FROM alpine:latest RUN apk --no-cache add ca-certificates=20161130-r2 openssl=1.0.2k-r0 But when I run docker build, here is the error I get: RUN apk --no-cache add c...
Pensu
12

votes
5

answer
6k

Views

Is there a way to lint the Dockerfile?

If a Dockerfile is written with mistakes for example: CMD ['service', '--config', '/etc/service.conf] (missing quote) Is there a way to lint it to detect such mistake before building?
eloone
1

votes
0

answer
229

Views

Docker not running flask app after successful creation and running

I am not able to make Docker work on my Flask app My flask app is successfully running locally with no errors I m not getting any errors while building and running docker container based on my dockerfile Docker successfully builds the entire image Flask successfully runs locally No errors are gettin...
smk
1

votes
0

answer
92

Views

How can I write this as CMD [ … ] syntax?

It's good practice to start the service with CMD ['/go/bin/myapp'] instead of CMD /go/bin/myapp In the first way, SIGTERMs are caught by the applicaiton, while in the second way, they are caught by the underlying /bin/sh script, which does not forward them to the service. I learned this from https:/...
John Somen
1

votes
0

answer
182

Views

Docker distributed cache

I'm looking for a solution to share docker cache across multiple CI instances The main use case is when building a new image using instance A, then building the same image using instance B from scratch, instead of having shard docker cache This causes longer build / push time, and it can be shortene...
gCoh
1

votes
0

answer
79

Views

How can I make PyCharm recognize Dockerfiles that are not called exactly Dockerfile?

In my project, there are several Dockerfiles. As they are in the same folder they can't all be named Dockerfile. PyCharm only styles the one named Dockerfile as Dockerfile. Dockerfile_1, for example, gets no styling and no inspections.
Anna Ira Hurnaus
1

votes
1

answer
738

Views

Docker: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

Dockerfile FROM python:2.7 as python CMD ['bash'] FROM ubuntu COPY --from=python /usr/local /usr/local Then, docker build -t ubuntuapp . docker run ubuntuapp /usr/local/bin/python Output: local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No...
ealeon
1

votes
1

answer
779

Views

Dockerfile for a gitlab container

I am doing a school project where I must install gitlab ce in a debian Docker container. I came up with something but the gitlab installer gets stuck on : ruby_block[supervise_redis_sleep] action run I read somewhere you can Ctrl+C and reconfigure to skip this error but as it is a school project I c...
Emmanuel Ruaud
1

votes
1

answer
1.5k

Views

psql: could not translate host name “postgres” to address: Temporary failure in name resolution

i cloned from github a docker-mail repository 'https://github.com/1it/docker-mail' and ran the docker-compose.yml. It created 6 containers and 6 images. Then i have created a Dockerfile with a basis Image from one of these 6 Images 'dockermail_roundcube', to have only one Image which contains all se...
guguli
1

votes
0

answer
22

Views

Re-route backend routes between containers within the same host

Hi I'm new to docker containers. I have the following setup: The docker host is running on a Linux server, it is running 4 apps: reverse-proxy (nodejs-based) frontend container backend container active mq container All of them are running in my-network Here is the problem, I would like to re-route e...
Mathers
1

votes
0

answer
373

Views

Docker push fails after multiple retries on a specific layer

I'm trying to push my own docker image for an angular 5 project that I've built. My docker image extends the well known node:carbon image and runs the following commands: FROM node:carbon WORKDIR /usr/src/app COPY package.json . COPY package-lock.json . RUN npm install --no-optional COPY . . EXPOSE...
Tudor Ravoiu
1

votes
1

answer
2.4k

Views

Getting containers to run with a Jenkinsfile

I am having trouble with writing making Jenkinsfile. My environment: A server running docker Jenkins is running as a container on the server I have a Docker image on DockerHub, and I have no problem fetching that image. My Jenkinsfile currently looks like this: pipeline { agent { docker { imag...
emilrn
1

votes
0

answer
26

Views

Can dockerfile comments be in foreign languages?

I am translating documentation for non-English users learning Docker. We have some example Dockerfiles with comments which we would like to translate for better understanding by the students. Are non-English languages, specifically Japanese, allowed in Dockerfile comments? If the students copy/paste...
Sara Hammer
1

votes
0

answer
581

Views

Running the basic .NET Core MVC App on SSL, HTTPS inside Docker Container

I am learning how to run my .net core web applications on docker (on windows host) with SSL. I started with the basic application that .net core gives by doing 'dotnet new mvc'. Then I moved ahead and modified the code inside Program.cs to listen only on port 443. public static IWebHost BuildWebHos...
thinkmmk
1

votes
1

answer
18

Views

How to make dockerfile and .conf file are not accessible direct through url

How to make dockerfile and .conf file are not accessible direct through url Look this url http://localhost/dockerfile http://localhost/nginx.conf If I Open this url this files are downloadable which should be not. How can i prevent this?
ImBS

View additional questions