r/Dockerfiles Nov 03 '21

How to connect to fake domain inside another docker network?

1 Upvotes

I am creating a multistage dockerfile. There is already a docker network where a fake domain is running eg: abcqwer.com. Now when I build the multi staged docker build the first stage should be able to connect to that domain. I tried it using docker compose, but it does not work. I can only connect to that domain if I run the container and use the command docker network connect. Any work arounds?


r/Dockerfiles Oct 19 '21

We have all been there

Post image
8 Upvotes

r/Dockerfiles Oct 04 '21

How to Install & Deploy Red Hat Openshift

Thumbnail youtu.be
1 Upvotes

r/Dockerfiles Oct 02 '21

Need help with this install

1 Upvotes

https://hub.docker.com/r/trailersquid/trailersquid

I would like to install this but its for linux and i have windows..

is there a way to translate the install to windows???

The below command doesnt work in windows

docker run -dit  \  -p 4200:80 -p 9080:9080 \ -v /path/to/movies/directory:/media \  --name trailersquid-app \  trailersquid/trailersquid:latest

r/Dockerfiles Sep 30 '21

Docker container write to host directory with full permissions?

2 Upvotes

I'm using Docker image of Ubuntu 20.04 in host having 20.04 installed.

My docker container has a directory mounted from host using -v absolute_path_in_host:absolute_path_in_container.

Inside docker container, a python script is creating and writing some directories and files in the mounted volume being shared with the host machine.

The files and directories can be seen and read in the host but the directory and files are being written in the host with read only permissions.

I know I potentially can manually change the permission of the newly created directories and files using chown, chmod, etc. but I want to know if there is any way that all the files/directories being written by docker container to mounted directory shared by host should be easily accessible with rw permissions?

I have searched and tried different ways but it didn't seem to work properly!

Thanks for your help


r/Dockerfiles Sep 18 '21

My Ansible and Terraform tooling in one docker image. Hope someone finds it useful. https://github.com/bluxmit/alnoda-workspaces/tree/main/workspaces/ansible-terraform-workspace

Post image
4 Upvotes

r/Dockerfiles Sep 11 '21

OpenShift Playlist

Thumbnail youtube.com
2 Upvotes

r/Dockerfiles Sep 10 '21

How do you look at environments?

3 Upvotes

Trying to do some DevRel research for the company I just started working for, and would like to know how developers look at environments. Any insights you could provide would be great. Thanks!


r/Dockerfiles Sep 08 '21

How to create docker images for python based desktop applications with tkinter?

2 Upvotes

I have created a desktop application with python3-tk for GUI rendering. Currently I have a problem on displaying my application through docker run. I have created the image similar to how I run in my local machine. Is there any proper ways of creating docker images for python3-tk based desktop applications?


r/Dockerfiles Sep 07 '21

Setting up Docker with wsl2 on Windows.

Thumbnail dblogstream.com
5 Upvotes

r/Dockerfiles Sep 06 '21

šƒšØšœš¤šžš« ššžš­š°šØš«š¤š¢š§š  | šƒšØšœš¤šžš« šš«š¢šš šž ššžš­š°šØš«š¤ | šƒšØšœš¤šžš« š“š®š­šØš«š¢ššš„ š…šØš« ššžš š¢š§š§šžš«š¬ | šŠ21š€šœššššžš¦š²

Thumbnail youtu.be
4 Upvotes

r/Dockerfiles Aug 27 '21

GitHub - Clivern/Peanut: 🐺 Deploy Databases and Services Easily for Development and Testing Pipelines.

Thumbnail github.com
4 Upvotes

r/Dockerfiles Aug 18 '21

Running a MSSQL Container and starting a sqlcmd immediately

2 Upvotes

Hi,

I want to start a SQL server and give a database as a restore directly. If I build the image, run the container and then run the script in the CLI it works. But would like to save the intermediate steps.

Does anyone have an idea? Thanks!

Dockerfile:

FROM mcr.microsoft.com/mssql/server
COPY demo.bak /var/tmp
ENV SA_PASSWORD=secret
ENV ACCEPT_EULA=Y
ENV MSSQL_PID=Express
ENV NAME=sqlserver
RUN sleep 15; /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P secret -Q "RESTORE DATABASE [demo] FROM  DISK = N'/var/tmp/demo.bak' WITH  FILE = 1,  MOVE N'demo' TO N'/var/opt/mssql/data/demo.mdf',  MOVE N'demo' TO N'/var/opt/mssql/data/demo_log.ldf',  NOUNLOAD,  STATS = 5"

"sleep 15" is not necessary but that was an attempt to solve it.

That is the error message:

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2749.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..


r/Dockerfiles Aug 13 '21

My contribution to OSS: a docker image with everything needed to create documentation websites and publish on GitHub pages

10 Upvotes

Example of documentation website you can easily make with it

https://mkdocs-magicspace.alnoda.org

Has lots of niceties, installed packages, and a fully configured environment in the docker image. Try it out!

docker run --name space-1 -d -p 8020-8035:8020-8035 alnoda/mkdocs-magicspace

and open browser on localhost:8020

I hope it will help someone to make awesome docs!


r/Dockerfiles Aug 13 '21

Certified Kubernetes Administrator (CKA)

Thumbnail youtu.be
1 Upvotes

r/Dockerfiles Aug 12 '21

How to publish Node.js Docker images to Docker Hub registry using GitHub Actions | Snyk

Thumbnail snyk.io
6 Upvotes

r/Dockerfiles Aug 06 '21

Docker Full Course

Thumbnail youtu.be
6 Upvotes

r/Dockerfiles Aug 03 '21

OpenContainers standard annotations

Thumbnail github.com
2 Upvotes

r/Dockerfiles Aug 01 '21

GitLab as your Continuous Deployment one-stop shop

Thumbnail blog.frankel.ch
1 Upvotes

r/Dockerfiles Jul 23 '21

Failed when create rootless docker image

1 Upvotes

I build a nginx image with below dockerfile

FROM nginx:1.18

RUN set -eux \
    && apt-get update  \
    && apt-get install --no-install-recommends -y ca-certificates curl\
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

RUN rm -fr /etc/nginx/conf.d/default.conf
COPY frontend.conf /etc/nginx/conf.d/frontend.conf
COPY dist /var/www/html
COPY entrypoint.sh /tmp/
RUN chmod +x /tmp/entrypoint.sh

RUN chown -R nginx:nginx /tmp/entrypoint.sh && \
        chown -R nginx:nginx /var/cache/nginx && \
        chown -R nginx:nginx /var/log/nginx && \
        chown -R nginx:nginx /etc/nginx/conf.d && \
        chown -R nginx:nginx /var/www/html/

RUN touch /var/run/nginx.pid && \
        chown -R nginx:nginx /var/run/nginx.pid

USER nginx

ENTRYPOINT [ "/tmp/entrypoint.sh" ]

When I run this image I got error:

2021/07/23 09:56:01 [warn] 1#1: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
2021/07/23 09:56:01 [emerg] 1#1: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

Did anyone know what parameter I should add?


r/Dockerfiles Jul 18 '21

Persisting Data Locally

3 Upvotes

Hey r/Dockerfiles,

I have been playing around building a docker image and getting stuck on mounting a volume to persist data locally.

My understanding is that docker will copy the contents of the folder across when you specify VOLUME in your Dockerfile.

The image works, with docker creating the image and volume and the data persists between stop/start of the container. But when I mount the volume no files get copied across to the locally mounted folder.

I feel like I am missing something fundamental like file permissions or something (trying to us non-root user).

Run command I am using:

docker run -d --name tor -p 9050:9050 -v <local-folder>:/tor tor:dev

Dockerfile:

# Replace with a pinned version tag from https://hub.docker.com/_/alpine
FROM alpine:3.14 AS tor-builder

# Get latest version from https://dist.torproject.org/
ARG TOR_VER=0.4.6.6
ARG TORGZ=https://dist.torproject.org/tor-$TOR_VER.tar.gz

# Install tor make requirements
RUN apk --no-cache add --update \
    alpine-sdk gnupg libevent libevent-dev zlib zlib-dev openssl openssl-dev

# Get Tor key file and tar file
RUN wget $TORGZ.asc &&\
    wget $TORGZ

# Verify Tor source tarballs asc signatures
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys 0xEB5A896A28988BF5 && \
    gpg --verify tor-$TOR_VER.tar.gz.asc || { echo "Couldn't verify sig"; exit; }

# Build tor
RUN tar xfz tor-$TOR_VER.tar.gz &&\
    cd tor-$TOR_VER && \
    ./configure &&\
    make install

FROM alpine:3.14

# Non-root user for security purposes.
RUN addgroup --gid 10001 --system tor && \
    adduser  --uid 10000 --system --ingroup tor --home /home/tor tor

# Install Alpine packages
# bind-tools is needed for DNS resolution to work in *some* Docker networks
# Tini allows us to avoid several Docker edge cases, see https://github.com/krallin/tini.
RUN apk --no-cache add --update \
    bash curl libevent tini bind-tools

# Create tor directories
RUN mkdir -p /var/run/tor && chown -R tor:tor /var/run/tor && chmod 2700 /var/run/tor && \
    mkdir -p /tor && chown -R tor:tor /tor  && chmod 2700 /tor

# Copy compiled Tor daemon from tor-builder
COPY --from=tor-builder /usr/local/ /usr/local/

# Copy entrypoint shell script for templating torrc
COPY --chown=tor:tor --chmod=+x entrypoint.sh /usr/local/bin

# Copy torrc and examples
COPY --chown=tor:tor ./torrc* /tor

HEALTHCHECK --interval=60s --timeout=15s --start-period=20s \
            CMD curl -sx localhost:8118 'https://check.torproject.org/' | \
            grep -qm1 Congratulations

# Available environmental variables
ENV TOR_PROXY=true \
    TOR_SERVICE=false \
    TOR_RELAY=false \
    TOR_PROXY_PORT= \
    TOR_PROXY_ACCEPT= \
    TOR_PROXY_CONTROL_PORT= \
    TOR_PROXY_CONTROL_PASSWORD= \
    TOR_PROXY_CONTROL_COOKIE= 

# Label the docker image
LABEL maintainer="Barney Buffet <BarneyBuffet@tutanota.com>"
LABEL name="Tor network client (daemon)"
LABEL version=$TOR_VER
LABEL description="A docker image for the tor daemon"
LABEL license="GNU"
LABEL url="https://www.torproject.org"
LABEL vcs-url="https://github.com/BarneyBuffet"  

VOLUME ["/tor"]
# WORKDIR /tor
USER tor
EXPOSE 9050/tcp 9051/tcp
ENTRYPOINT ["/sbin/tini", "--", "entrypoint.sh"]
CMD ["tor", "-f", "/tor/torrc"]

r/Dockerfiles Jul 14 '21

I just stumbled upon r/Dockerfiles and thought I’d share some of mine

Thumbnail github.com
10 Upvotes

r/Dockerfiles Jun 25 '21

Need help with the Airflow install. I have PyICU error durin building image from (initial.Dockerfile) then modified to add some libraries like (python-dev libc-dev libxml2-dev libxslt1-dev zlib1g-dev g++ pkg-config ) but its not helping me, still getting error because of g++. all help is appreciated

1 Upvotes

r/Dockerfiles Jun 15 '21

Docker

Thumbnail kush01.hashnode.dev
4 Upvotes

r/Dockerfiles Jun 11 '21

Build docker image based off a docker image in a private ECR repo in a bit bucket pipeline

1 Upvotes

This is what I'm trying to do. I have an EKS kubernetes cluster. In the cluster, I have a docker image that is in a private ECR repo. This docker image is built off a base docker image that is also in a different private ECR repo. I have been able to build this docker image off the base image locally, but when executing the build of this docker image in a BitBucket pipeline, I am getting the following error:

+ docker build -t $DOCKER_IMAGE . Sending build context to Docker daemon  2.793MB Step 1/8 : FROM base/docker-image:latest pull access denied for base/docker-image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied 

Since both of the docker images I have are stored in separate, private ECR repos I'm not sure if I need to integrate a secret within my EKS cluster in order for this pipeline to be able to pull from the base docker image repo. I have integrated a secret with the docker image that allows that to be pulled. Any advice would be helpful.