Docker

Docker is a computer program used to run software packages called containers in an operating-system-level virtualization process called containerization. It’s developed by Docker, Inc. and was first released in 2013.

Share tech news, updates, or what's on your mind.

Sign up to Post

how to configure aws configure in docker file

my docker file

FROM ubuntu


RUN apt-get update && apt-get install -y awscli


cmd docker pull mariadb
cmd  docker pull mysql
CMD ["/test.sh"]

test.sh
 aws configure set aws_access_key_id default_access_key xxxxxx
 aws configure set aws_secret_access_key default_secret_key xxxxxx
aws configure set default.region us-west-2
 
aws s3 cp s3://mariadbs3bucket/test.txt /test

 mysql -u xxx-pxxx --host xxx -P 3306  --socket=TCP/IP  -e "USE myDB; insert into myDB.tt values(50000);"

the above both command are working fine while running in ec command line
there i have set the aws configure
0
Choose an Exciting Career in Cybersecurity
Choose an Exciting Career in Cybersecurity

Help prevent cyber-threats and provide solutions to safeguard our global digital economy. Earn your MS in Cybersecurity. WGU’s MSCSIA degree program was designed in collaboration with national intelligence organizations and IT industry leaders.

how to access s3 bucket in the docker file.

its expecting aws configure , i export the  key's but its does not help for me!!!
0
Hi Experts,

     I had build and run a docker image like this.

docker build -t harvest-trove:1.0.3 .
docker run --name trove_pull ${trove_environment[@]} -d -restart always harvest-trove:1.0.3 start pull                 

Open in new window


I want to use docker compose for the above two commands

I had created the docker compose like this.

version:'3'
services:
   harvest-trove:
      build: .
      image: harvest-trove:1.0.3
      volumes:
                -  .:/home/trove
           env_file:
        -  web-variables.env
            command: python3 manage.py migrate
  trove-pull:
    container_name:trove-pull     
    image: harvest-trove
    env_file:
       - web-variables.env
       depends_on:
         - harvest-trove
       command: harvest-trove:1.0.3 start pull
       restart:always

Open in new window


when I run docker-compose up I get the following error.

error with docker-compose up
Please help me in fixing this issue.

With Many thanks,
Bharath AK
0
How to connect already running mariadb container

I found this query

$ docker run --name appName --link some-mariadb:mysql -d application-that-uses-mysql

i am confuse with the syntax ?
can any one tell me how to use this ??
0
How to download awscli docker image  (I try docker run awscli it ask password without that is it possible)

How to download mariaDB docker image  (I try docker run mariaDB it ask password without that is it possible)
0
Hi Experts,
How to install apparmor in alpine Linux docker image.
Please share me the steps to do it.
0
how to read the csv file which is in AWS s3 bucket

aws s3 cp command will copy the file but i need to validate before copy the file ? is that possible ?
0
what are the package i need to import docker shell script to read AWS s3 bucket file
0
Hi Experts,

     docker container is not picking the recent changes from the source code.     it makes me to build the docker image every time to see the latest changes on the source code.

Please find below the contents of the Dockerfile

FROM ubuntu:16.04

MAINTAINER *****

RUN apt-get update -y
RUN apt-get install -y software-properties-common python-software-properties curl
RUN add-apt-repository -y ppa:fkrull/deadsnakes

RUN apt-get update -y && apt-get install -y curl
RUN apt-get update -y && apt-get install -y \
	git \
	python3.6 \
	python3.6-dev \
	nginx \
	sqlite3 \
	nodejs \
	build-essential \
	libmagickwand-dev \
	cron \
	nginx

RUN rm -f /usr/bin/python3
RUN ln -s /usr/bin/python3.6 /usr/bin/python3
RUN curl https://bootstrap.pypa.io/get-pip.py | python3

WORKDIR /home/trove
COPY . .

COPY build/docker/uwsgi_params .
COPY build/docker/uwsgi.ini .
RUN pip3 install --no-cache-dir uwsgi
RUN pip3 install --no-cache-dir -r requirements.txt

COPY build/docker/start /usr/bin/
COPY build/docker/crontab /etc/cron.d/harvest-cron
RUN chmod 0644 /etc/cron.d/harvest-cron
RUN touch /var/log/harvest.log

RUN echo "daemon off;" >> /etc/nginx/nginx.conf
COPY build/docker/nginx-app.conf /etc/nginx/sites-available/default
COPY build/docker/start /usr/bin/
RUN mkdir /var/log/harvest/
RUN python3 manage.py collectstatic --noinput

WORKDIR /home/trove/
RUN chmod 755 /home/trove
RUN chown -R www-data:www-data /home/trove

EXPOSE 80
CMD ["start"]

Open in new window


please find below the contents of the crontab

SHELL=/bin/bash
* * * * * root ( source /tmp/environment.sh && /usr/bin/python3 /home/trove/run.py $(cat /tmp/method) ) >> /dev/null 2>/var/log/harvest/ts_errors.log

Open in new window

0
how to write docker script to update maria DB

1. How to connect docker to Maria DB
2. How to do insert and update in Maria DB
0
Powerful Yet Easy-to-Use Network Monitoring
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

What are all the package need to access docker to lambda


lambda will call s3 bucket .

I need automated script (that script will daily mid night will run)
0
how we can read s3 bucket files form docker container
what are the package needed and what is the command

how we can put data to maria DB form docker container
what are the package needed and what is the command
0
Hi Experts,

   I got a server which runs applications with docker and aws, running from console(putty).  The command to run is as follows:-

docker run --name ts_pull ${ts_environment[@]}  -d  --restart always 1234656458.dkr.ecr.ap-southeast-2.amazonaws.com/harvest-ts:1.0.2 start pull

Open in new window


I can understand 1234656458.dkr.ecr.ap-southeast-2.amazonaws.com/harvest-ts:1.0.2 is from aws.  Can any tell me how this container application is pushed to aws?

From the documentation I found Dockerfile is available, from which the docker image is built.  I don't understand how to push this to aws and run with the docker.

Please throw some light over it.

with many thanks,

Bharath AK
0
Hi Experts,

   How to delete the existing elasticsearch cluster and how to create a new elasticsearch cluster?  Please throw some best practices.

With Many thanks,

Bharath AK
0
Hi,

I have a task in AWS that is started by ECS. I have developed a Cloudformation script that creates the ECS cluster, service, task definitions and containers.

The EC2 instances (2 to begin with) are initiated and are healthy. ECS then creates the tasks on each EC2 instance. However, have 1 minute, the tasks are stopped by ECS and it tries to recreate it. I presume this is something to do with the scheduler on AWS and not getting a healthy check back.

It is a node app running on port 300 which is mapped to the container. If I login to the EC2 instance and do a simple curl 127.0.0.1:32XXX (host port) then I get "no reply from server". Ok so it is something wrong with the image or container.

However, if I launch my own container of the same image publishing the ports ("docker run -d -p 32810:3000 <image> yarn start") and then do curl 127.0.0.1:32810 then I get a response from the server.

I cannot figure out how to debug this as there are no logs with any errors. Anyway..(I created the one on port 32810) the image is the same in both. I can only figure it is something to do with what the ECS agent does when it boots a task.

48ccad832ad2        <image>   "yarn start"        9 seconds ago       Up 8 seconds        0.0.0.0:32831->3000/tcp   ecs-test-InterfaceCogTaskDefinition-1UE2FONT2RQU3-1-InterfaceCog-f092fec2d9d1e8a90300
36016de55b81        <image>   "yarn start"        23 minutes ago      Up 23 minutes       0.0.0.0:32810->3000/tcp   practical_banach

0
Hi Experts,

      I have two containers running on dockers.  

root@ip-10-252-14-11:/home/ubuntu/workarea/sourcecode/ntdl# docker container ls
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                  NAMES
596874f0eedb        dcf3be75c970        "start"             8 days ago          Up 8 days           0.0.0.0:8009->80/tcp   iiif
91c61a7ea455        8a38b977270d        "start"             8 days ago          Up 8 days           0.0.0.0:8008->80/tcp   ntdl

Open in new window


wagtail(Django)  (ntdl )application on port 8008
wagtail application similar to django applicationimage server running independently on 8009
IIIF IMAGE Serverwagtail (ntdl) without zoom image not communicating with iif image server
wagtail application not talking to iiif image server
without zoom image from image server
console logs details
console log on browser windowconsole logs
::net ERR_CONNECTION_REFUSED for accessing iiif_image server.  

nginx is installed with wagtail ntdl application
Please help me in resolving this issue.



With many thanks,
Bharath AK
0
How is Docker different from a virtual machine?  How does it manage to provide a full filesystem, isolated networking environment, etc. without being as heavy?
0
can anybody give me exact docker compose yml file which will install nginx php mysql to run wordpress
final wordpress need to be run on container with example.com or serverip and on port 80
0
I have to admit that I'm lost on a lot of these apps and languages that appear to be endless rabbit holes to me  but for my own enjoyment and education I'm trying to build a really nice media appliance.
Everything was working fine and then I took the step of installing super transfer 2, it installed docker which is what I believe was the cause of the pages not being found. The webserver is running because I get "Not Found
The requested URL /setup/ was not found on this server.

Apache/2.4.18 (Ubuntu) Server at 10.1.3.39 Port 80"
So I'm kind of stuck and there doesn't appear to be any support on the topic in the plexguide forums.
0
Redefine Your Security with AI & Machine Learning
Redefine Your Security with AI & Machine Learning

The implications of AI and machine learning in cyber security are massive and constantly growing, creating both efficiencies and new challenges across the board. Check out our on-demand webinar to learn more about how AI can help your organization!

Hi experts,

I get bad gateway request.  I use nginx, uwsgi docker wagtail application.  Please find attached nginx.ini and uwsgi.ini  I am running all inside a docker containers.

nginx settings

user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include 

Open in new window

0
While running the docker-compose up for git project Linked-Data-Theater I am getting
error standard_init_linux.go:195: exec user process caused no such file or directory

Below is a stack trace,

ifour.techno@ifour-137 MINGW64 /d/test/Docker/LinkData_Theater_Repo/Linked-Data-Theatre (master)
$ docker-compose up
Starting virtuoso ...
Starting ldt ... done
Attaching to virtuoso, ldt
virtuoso    | standard_init_linux.go:195: exec user process caused "no such file or directory"
ldt         | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log
ldt         | INFO: Server version:        Apache Tomcat/7.0.85
ldt         | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log
ldt         | INFO: Server built:          Feb 7 2018 18:52:33 UTC
ldt         | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log
ldt         | INFO: Server number:         7.0.85.0
ldt         | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log
ldt         | INFO: OS Name:               Linux
ldt         | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log
ldt         | INFO: OS Version:            4.4.111-boot2docker
ldt         | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log
ldt         | INFO: Architecture:          amd64
ldt         | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log
ldt     

Open in new window

0
I'm not too familiar with Docker or networking in general so I'm getting confused as to whats going on in my Docker Compose file below.

1. Would each of the services be available to the host machine at something like http://localhost:4200 ?

2. If the answer is yes above, how would I ensure that the correct ports are exposed between containers but not accessible to the host machine? Does it involve defining a network instead of relying on the default one?

version: '3' # specify docker-compose version

# Define the services/containers to be run
services:
  angular: # name of the first service
    build: ./Coding/DeepLearning/GardenApp/client-app-dev # specify the directory of the Dockerfile
    ports:
      - "4200:4200" 
    volumes:
      - ./Coding/DeepLearning/GardenApp/client-app:/usr/src/garden-app-dev

  express-ts: #name of the second service
    build: express-ts-server # specify the directory of the Dockerfile
    ports:
      - "3000:3000" 
    links:
      - database # link this service to the database service
    volumes:
      - ./Coding/DeepLearning/GardenApp/express-ts-server:/usr/src/express-ts-app

  database: # name of the third service
    image: mongo # specify image to build container from
    ports:
      - "27017:27017" 
    volumes: 
      - ./Coding/DeepLearning/GardenApp/database:/data/db

Open in new window

0
We have a docker container running NGINX and the certificate expired a week ago. I am now stuck trying to figure out what system to generate a CSR on, would it be the virtual machine docker is running on?
0
Hi all,

I have been working with learning AWS and currently doing a course on scaling docker to aws.  Looking for some real world feedback of good architecture.  Amazon EKS is in preview so I am going to look there if it goes mainstream.  For now I am trying to understand what is best to use aka setup an ECS cluster, task definitions and should I also use application load balancer or elastic load balancers etc. to create a solid setup for failover.  My goal is take one front end app for example maybe spread across 3 AZs in docker containers (learning docker).  I will also have a web api also in a container not sure if that also makes sense to have the same setup across 3 AZs etc.  Any suggestions if you had a front end and api how would be best real world to set it up with docker and instances?   Thanks all.
0
Hello, how can I start a container and open new ports?
0

Docker

Docker is a computer program used to run software packages called containers in an operating-system-level virtualization process called containerization. It’s developed by Docker, Inc. and was first released in 2013.

Related Topics

Top Experts In
Docker
<
Monthly
>