Giter Site home page Giter Site logo

gliderlabs / docker-alpine Goto Github PK

View Code? Open in Web Editor NEW
5.7K 129.0 525.0 92.25 MB

Alpine Linux Docker image. Win at minimalism!

Home Page: http://gliderlabs.viewdocs.io/docker-alpine

License: BSD 2-Clause "Simplified" License

Shell 89.14% Dockerfile 10.86%

docker-alpine's Introduction

docker-alpine

CircleCI Docker Stars Docker Pulls Slack

A super small Docker image based on Alpine Linux. The image is only 5 MB and has access to a package repository that is much more complete than other BusyBox based images.

Why?

Docker images today are big. Usually much larger than they need to be. There are a lot of ways to make them smaller, but the Docker populace still jumps to the ubuntu base image for most projects. The size savings over ubuntu and other bases are huge:

REPOSITORY          TAG           IMAGE ID          VIRTUAL SIZE
gliderlabs/alpine   latest        9cfff538e583      4.803 MB
debian              latest        19134a8202e7      123.1 MB
ubuntu              latest        104bec311bcd      129 MB
centos              latest        67591570dd29      191.8 MB

There are images such as progrium/busybox which get us very close to a minimal container and package system. But these particular BusyBox builds piggyback on the OpenWRT package index which is often lacking and not tailored towards generic everyday applications. Alpine Linux has a much more complete and up to date package index:

$ docker run progrium/busybox opkg-install nodejs
Unknown package 'nodejs'.
Collected errors:
* opkg_install_cmd: Cannot install package nodejs.

$ docker run gliderlabs/alpine apk add --no-cache nodejs
fetch http://alpine.gliderlabs.com/alpine/v3.3/main/x86_64/APKINDEX.tar.gz
fetch http://alpine.gliderlabs.com/alpine/v3.3/community/x86_64/APKINDEX.tar.gz
(1/4) Installing libgcc (5.3.0-r0)
(2/4) Installing libstdc++ (5.3.0-r0)
(3/4) Installing libuv (1.7.5-r0)
(4/4) Installing nodejs (4.2.3-r0)
Executing busybox-1.24.1-r7.trigger
OK: 29 MiB in 15 packages

This makes Alpine Linux a great image base for utilities and even production applications. Read more about Alpine Linux here and you can see how their mantra fits in right at home with Docker images.

Usage

Stop doing this:

FROM ubuntu-debootstrap:14.04
RUN apt-get update -q \
  && DEBIAN_FRONTEND=noninteractive apt-get install -qy mysql-client \
  && apt-get clean \
  && rm -rf /var/lib/apt
ENTRYPOINT ["mysql"]

This took 19 seconds to build and yields a 164 MB image. Eww. Start doing this:

FROM gliderlabs/alpine:3.4
RUN apk add --no-cache mysql-client
ENTRYPOINT ["mysql"]

Only 3 seconds to build and results in a 36 MB image! Hooray!

Documentation

This image is well documented. Check out the documentation at Viewdocs and the docs directory in this repository.

Contacts

We make reasonable efforts to support our work and are always happy to chat. Join us in our Slack community or submit a GitHub issue if you have a security or other general question about this Docker image. Please email security or user mailing lists if you have concerns specific to Alpine Linux.

Inspiration

The motivation for this project and modifications to mkimage.sh are highly inspired by Eivind Uggedal (uggedal) and Luis Lavena (luislavena). They have made great strides in getting Alpine Linux running as a Docker container. Check out their mini-container/base image as well.

Sponsors

Fastly

Fastly provides the CDN for our Alpine Linux package repository. This allows super speedy package downloads from all over the globe!

License

The code in this repository, unless otherwise noted, is BSD licensed. See the LICENSE file in this repository.

docker-alpine's People

Contributors

alexkreidler avatar andyshinn avatar antoniomeireles avatar duncanbeevers avatar francisfuzz avatar frewsxcv avatar frol avatar gigablah avatar imikushin avatar inz avatar josegonzalez avatar jvirtanen avatar kakakakakku avatar mkumatag avatar moul avatar mtgto avatar muhmuhten avatar ncopa avatar nikai3d avatar pbestler avatar peterdavehello avatar piperchester avatar progrium avatar tianon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-alpine's Issues

x86_64 images

Are there plans to have a x86_64 version?
I need to run an 64bit-only app inside a container and wanted to use the alpine docker image, but realized there is only a 32bit version.

Error When Developing

It seems like when I mount a volume on top of my code, the files aren't properly changing. This seems to only happening when I'm using alpine, other images work great.

Here's the steps to reproduce.

Example Dockerfile:

FROM alpine:3.2
RUN apk add --update python git python-dev py-pip gcc libgcc musl-dev && \
    pip install --upgrade pip

WORKDIR /home
COPY requirements.txt /home/
RUN pip install -r requirements.txt
COPY . /home
CMD ["sh"]

Note most of the installs are not needed for this example, but I've needed them for a few python packages, so leaving for this example in case that's possible issue

This isn't being used, but just in case (and I do plan on using some packages)
./requirements.txt

yamlsettings==0.2.2

./test.py

print "1"
print "2"
print "3"

Build the image:

docker build  -f Dockerfile -t local/movie_tags:dev .

Run the image (with deving in mind):

docker run -it --rm -v $(pwd):/home local/movie_tags:dev

Within the docker container:

> python test.py
1
2
3

On my host system edit test.py and add a line with print "4" and then back in the container:

> python test.py
1
2
3
> cat test.py
print "1"
print "2"
print "3"
> vi test.py
print "1"
print "2"
print "3"
print "4"
> python test.py
1
2
3

It seems very odd that vi see the correct files, but the python and cat processes seem to have a link to the old file....

docker info:

Containers: 0
Images: 51
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 51
Execution Driver: native-0.2
Kernel Version: 3.18.5-tinycore64
Operating System: Boot2Docker 1.5.0 (TCL 5.4); master : a66bce5 - Tue Feb 10 23:31:27 UTC 2015
CPUs: 8
Total Memory: 1.961 GiB
Name: boot2docker
ID: OSTT:VV2Y:LHSF:2N46:KIDT:FZC5:JKNQ:O5KE:P5YW:A4DN:OWCM:O6P3
Debug mode (server): true
Debug mode (client): false
Fds: 11
Goroutines: 16
EventsListeners: 0
Init Path: /usr/local/bin/docker
Docker Root Dir: /mnt/sda1/var/lib/docker

boot2docker version

Boot2Docker-cli version: v1.5.0
Git commit: ccd9032

Also building and running without the mounting works great, but that won't work well while developing.

Please let me know if you've seen this issue, or if anyone can reproduce it Thanks.

Unable to install bundler under alpine:edge

I get the following error when trying to do gem install bundler under alpine:edge:

$ { echo 'FROM alpine:edge'; echo 'RUN apk --update add ca-certificates ruby'; echo 'RUN gem install bundler --no-document'; } | docker bui
ld -
Sending build context to Docker daemon 2.048 kB
Sending build context to Docker daemon 
Step 0 : FROM alpine:edge
 ---> a52f3898af70
Step 1 : RUN apk --update add ca-certificates ruby
 ---> Running in 16a26acb63f9
fetch http://dl-4.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
(1/14) Installing run-parts (4.4-r0)
(2/14) Installing openssl (1.0.2a-r0)
(3/14) Installing lua5.2-libs (5.2.3-r0)
(4/14) Installing lua5.2 (5.2.3-r0)
(5/14) Installing lua5.2-posix (32-r2)
(6/14) Installing ca-certificates (20141019-r0)
(7/14) Installing libffi (3.2.1-r0)
(8/14) Installing gdbm (1.11-r0)
(9/14) Installing ncurses-terminfo-base (5.9-r3)
(10/14) Installing ncurses-libs (5.9-r3)
(11/14) Installing readline (6.3-r3)
(12/14) Installing yaml (0.1.6-r1)
(13/14) Installing ruby-libs (2.1.5-r1)
(14/14) Installing ruby (2.1.5-r1)
Executing busybox-1.23.1-r0.trigger
Executing ca-certificates-20141019-r0.trigger
OK: 20 MiB in 30 packages
 ---> 4635f61d4b56
Removing intermediate container 16a26acb63f9
Step 2 : RUN gem install bundler --no-document
 ---> Running in b1272a9377b9
ERROR:  Could not find a valid gem 'bundler' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/latest_specs.4.8.gz)
INFO[0014] The command [/bin/sh -c gem install bundler --no-document] returned a non-zero code: 2 

The same commands work under alpine:3.1:

$ { echo 'FROM alpine:3.1'; echo 'RUN apk --update add ca-certificates ruby'; echo 'RUN gem install bundler --no-document'; } | docker buil
d -
Sending build context to Docker daemon 2.048 kB
Sending build context to Docker daemon 
Step 0 : FROM alpine:3.1
 ---> b0b08730b93c
Step 1 : RUN apk --update add ca-certificates ruby
 ---> Running in 09434d674e8e
fetch http://dl-4.alpinelinux.org/alpine/v3.1/main/x86_64/APKINDEX.tar.gz
(1/14) Installing run-parts (4.4-r0)
(2/14) Installing openssl (1.0.1m-r0)
(3/14) Installing lua5.2-libs (5.2.3-r0)
(4/14) Installing lua5.2 (5.2.3-r0)
(5/14) Installing lua5.2-posix (32-r1)
(6/14) Installing ca-certificates (20141019-r0)
(7/14) Installing libffi (3.0.13-r0)
(8/14) Installing gdbm (1.11-r0)
(9/14) Installing ncurses-terminfo-base (5.9-r3)
(10/14) Installing ncurses-libs (5.9-r3)
(11/14) Installing readline (6.3-r3)
(12/14) Installing yaml (0.1.6-r1)
(13/14) Installing ruby-libs (2.1.5-r1)
(14/14) Installing ruby (2.1.5-r1)
Executing busybox-1.22.1-r14.trigger
Executing ca-certificates-20141019-r0.trigger
OK: 20 MiB in 29 packages
 ---> 8ba31161d445
Removing intermediate container 09434d674e8e
Step 2 : RUN gem install bundler --no-document
 ---> Running in 11cbbd70bfb6
Successfully installed bundler-1.9.1
1 gem installed
 ---> 0f7263878478
Removing intermediate container 11cbbd70bfb6
Successfully built 0f7263878478

The reason I switched to alpine:edge was to take advantage of the ruby-nokogiri package, which doesn't appear to be available under alpine:3.1:

$ docker run --rm alpine:3.1 apk --update add ruby-nokogiri
fetch http://dl-4.alpinelinux.org/alpine/v3.1/main/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  ruby-nokogiri (missing):
    required by: world[ruby-nokogiri]

Best way to add user?

I have a scenario where I would like to run a given process under a specific username but when I try to do something like adduser <name> I get a command: not found error. I see that Alpine has a useradd command but it is bombing also. Is there a way to create a user to use as a service acocunt with a blank password to get the Docker build to work? I guess this isn't specific to Alpine but I haven't been able to find a good workaround for this yet.

update-ca-certificates fails

When run under Docker, update-ca-certificates (from the package ca-certificates) fails with the line . All the information I can find seems to suggest it's a locale issue but the system profile seems to have the correct information. Any ideas?

The failure:

bash-4.3# update-ca-certificates
WARNING: ca-certificates.crt does not contain exactly one certificate or CRL: skipping

Default gateway

Posted this in the Alpine Linux forums but haven't gotten any responses. So I'm trying here, too.

I'm attempting to create an OpenVPN client using the gliderlabs/docker-alpine image. I've mostly succeeded, except that OpenVPN is unable to change the default gateway upon connection. The specific message is:

NOTE: unable to redirect default gateway -- Cannot read current default gateway from system

In trying to troubleshoot, I discovered that the 'route' command doesn't return a default gateway:

/openvpn # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.17.0.0      *               255.255.0.0     U     0      0        0 eth0

Though 'ip route' does:

/openvpn # ip r
default via 172.17.42.1 dev eth0
172.17.0.0/16 dev eth0  proto kernel  scope link  src 172.17.0.37

Compare/contrast with the output from the same commands run on a Debian image:

root@51e708159cd8:/# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.17.42.1     0.0.0.0         UG    0      0        0 eth0
172.17.0.0      *               255.255.0.0     U     0      0        0 eth0

root@51e708159cd8:/# ip r
default via 172.17.42.1 dev eth0
172.17.0.0/16 dev eth0  proto kernel  scope link  src 172.17.0.37

And for good measure, here are 'cat /proc/net/route' from both:

/openvpn # cat /proc/net/route
Iface   Destination     Gateway         Flags   RefCnt  Use     Metric  Mask            MTU     Window  IRTT
eth0    00000000        012A11AC        0003    0       0       0       00000000        0       0       0                                                                           
eth0    000011AC        00000000        0001    0       0       0       0000FFFF        0       0       0 

root@51e708159cd8:/# cat /proc/net/route
Iface   Destination     Gateway         Flags   RefCnt  Use     Metric  Mask            MTU     Window  IRTT
eth0    00000000        012A11AC        0003    0       0       0       00000000        0       0       0                                                                           
eth0    000011AC        00000000        0001    0       0       0       0000FFFF        0       0       0

Here's the 'route' output after connecting via OpenVPN in the Alpine container:

10.158.1.1      10.158.1.5      255.255.255.255 UGH   0      0        0 tun0
10.158.1.5      *               255.255.255.255 UH    0      0        0 tun0
172.17.0.0      *               255.255.0.0     U     0      0        0 eth0

And from 'ip route':

default via 172.17.42.1 dev eth0
10.158.1.1 via 10.158.1.5 dev tun0
10.158.1.5 dev tun0  proto kernel  scope link  src 10.158.1.6
172.17.0.0/16 dev eth0  proto kernel  scope link  src 172.17.0.37

I've tried replacing the default route manually after creating the VPN (ip route replace default via 10.158.1.5 dev tun0), but that breaks routing completely.

Am I missing something here, like a package or some networking nuance? Is this a BusyBox bug/feature? I'm happy to provide additional information. Any help would be greatly appreciated.

Default repository is unfriendly for caching proxies

Hello,

Alpine defaults use dl-4.alpinelinux.org in /etc/alpine/repositories, but this repository is unfriendly for caching proxies. In example Squid configured as a transparent caching proxy always logs TCP_MISS/200 to access.log. When I change repository to dl-3.alpinelinux.org then Squid properly cache downloaded files and logs TCP_HIT/200 to access.log.

Could You change this default repository to more friendly for caching proxies?

Regards,
Piotr Minkina

Support mono on Docker-Alpine

Greetings,

I was wondering if you could help me get mono running on your OS. I really like the whole idea about a minimal, hardened OS -- and having a small footprint means a quicker feedback loop in dev.

I've been chatting with some Alpine OS committers on the IRC chat and they have built a package for mono http://pkgs.alpinelinux.org/packages?package=mono%25&repo=all&arch=x86_64 -- except it's still not quite working. Could you help me make it work, you think?

Regards,
Henrik

Who's using Docker Alpine?

If your company or project is using gliderlabs/alpine or the official alpine image, please list yourself below!

Making use of OpenRC

Please stop me if I'm talking nonsense. I'm trying to figure out if OpenRC can be used as an alternative to supervisord. It comes already shipped with Alpine, it allows to start services and respawn them, and I saw a few notes that it also allows to send logs to stdout. That's kind of everything supervisord is doing in a simple case, right? But OpenRC doesn't require python and other dependencies that quadruple the final image size.

I've tried this:

$ docker run -ti alpine sh
/ # /sbin/init
init: must be run as PID 1
/ # /sbin/openrc
 * Caching service dependencies ...                                                                                                                                                               [ ok ]
/ # apk --update add nginx
…
/ # rc-service nginx start
 * Caching service dependencies ...                                                                                                                                                               [ ok ]
 * You are attempting to run an openrc service on a
 * system which openrc did not boot.
 * You may be inside a chroot or you may have used
 * another initialization system to boot this system.
 * In this situation, you will get unpredictable results!
 * If you really want to do this, issue the following command:
 * touch /run/openrc/softlevel
 * ERROR: fsck failed to start
 * ERROR: cannot start root as fsck would not start
 * ERROR: cannot start localmount as fsck would not start
 * ERROR: cannot start networking as fsck would not start
 * ERROR: cannot start nginx as fsck would not start
/ # touch /run/openrc/softlevel
/ # rc-service nginx start
 * Checking local filesystems  ... [ ok ]
 * Remounting filesystems ... [ ok ]
 * Mounting local filesystems ... [ ok ]
 * Starting networking ...
awk: /etc/network/interfaces: No such file or directory
 * ERROR: networking failed to start
 * ERROR: cannot start nginx as networking would not start

Then I tried to do it this, and it just goes into infinite loop:

$ docker run -ti alpine /sbin/init

   OpenRC 0.15.1.c4bc9ea is starting up Linux 4.0.3-boot2docker (x86_64)

 * /proc is already mounted
 * Mounting /run ...
mount: permission denied (are you root?)
 * Unable to mount tmpfs on /run.
 * Can't continue.
 * Caching service dependencies ...                                                                                                                                                               [ ok ]
can't open /dev/tty1: No such file or directory
can't open /dev/tty2: No such file or directory
can't open /dev/tty3: No such file or directory
can't open /dev/tty4: No such file or directory
can't open /dev/tty5: No such file or directory
can't open /dev/tty6: No such file or directory
can't open /dev/tty1: No such file or directory
can't open /dev/tty2: No such file or directory
can't open /dev/tty3: No such file or directory
can't open /dev/tty4: No such file or directory
can't open /dev/tty5: No such file or directory
can't open /dev/tty6: No such file or directory

Is there a way to use OpenRC instead of supervisord inside the container?

Go 1.3 and 1.4 test with race raise an exceptions

Tested in Alpine 3.2(go 1.4) and 3.1(go 1.3)

When tried to run tests with -race. I got next exception:

# runtime/race
race_linux_amd64.syso: In function `__sanitizer::InternalAlloc(unsigned long, __sanitizer::SizeClassAllocatorLocalCache<__sanitizer::SizeClassAllocator32<0ul, 140737488355328ull, 16ul, __sanitizer::SizeClassMap<17ul, 64ul, 14ul>, 24ul, __sanitizer::TwoLevelByteMap<2048ull, 4096ull, __sanitizer::NoOpMapUnmapCallback>, __sanitizer::NoOpMapUnmapCallback> >*)':
gotsan.cc:(.text+0x1130): undefined reference to `__libc_malloc'
race_linux_amd64.syso: In function `__tsan::WriteMemoryProfile(char*, unsigned long)':
gotsan.cc:(.text+0x929b): undefined reference to `__libc_mallinfo'
race_linux_amd64.syso: In function `__sanitizer::ReExec()':
gotsan.cc:(.text+0xa047): undefined reference to `__libc_stack_end'
race_linux_amd64.syso: In function `__sanitizer::InternalFree(void*, __sanitizer::SizeClassAllocatorLocalCache<__sanitizer::SizeClassAllocator32<0ul, 140737488355328ull, 16ul, __sanitizer::SizeClassMap<17ul, 64ul, 14ul>, 24ul, __sanitizer::TwoLevelByteMap<2048ull, 4096ull, __sanitizer::NoOpMapUnmapCallback>, __sanitizer::NoOpMapUnmapCallback> >*)':
gotsan.cc:(.text+0x4d8d): undefined reference to `__libc_free'
collect2: error: ld returned 1 exit status

Tried to use https://github.com/andyshinn/alpine-pkg-glibc also.

But it works without -race option: go test -v ./...

Created simple example to reproduce issue: https://gist.github.com/miry/fece267c7faba904c360

Not resolving using search domain

Hostname is not properly resolving within the container when setting --dns-search on Docker.

Docker settings:

DOCKER_OPTS="--bip=172.17.42.1/16 --dns=172.17.42.1 --dns=10.0.2.15 --dns-search=service.consul"

gliderlabs/alpine

vagrant@local:~$ docker run --rm -it gliderlabs/alpine sh
/ # ping consul
ping: bad address 'consul'
/ # ping consul.service.consul
PING consul.service.consul (10.211.55.22): 56 data bytes
64 bytes from 10.211.55.22: seq=0 ttl=64 time=0.045 ms

progrium/busybox

vagrant@local:~$ docker run --rm -it progrium/busybox
/ # ping consul
PING consul (10.211.55.22): 56 data bytes

gliderlabs/registrator#111

iptables-restore fails on Alpine when using the ipencap protocol

I'm trying to restore some iptables rules with using iptables-restore under Alpine and it's failing. Could this be cause of the way the iptables package is built?

This works fine on Ubuntu and Redhat.

FailedSystemCall: Failed system call (retcode : 2, args : ('iptables-restore', '--noflush', '--verbose'))
  stdout  : 
  stderr  : iptables-restore v1.4.21: unknown protocol "ipencap" specified
input  : *filter
:felix-INPUT -
:felix-FORWARD -
--flush felix-INPUT
--append felix-INPUT --protocol ipencap --match set ! --match-set felix-calico-hosts-4 src --jump DROP
COMMIT

Unprivileged user can gain root privileges

I'm not sure how the wheel group is treated in docker-alpine but why does it exist if one can gain root privileges without being member of it?

# docker run -i -t --name="test" alpine /bin/sh
/ # adduser -S testuser
/ # groups testuser
nogroup
# docker start test
# docker exec -it --user=testuser test /bin/sh
/ $ whoami
testuser
/ $ su
/ # whoami
root
/ # groups testuser
nogroup
/ # groups root
root bin daemon sys adm disk wheel floppy dialout tape video
/ # 

In ubuntu-docker this does not work.

apk fails to update/add.

Hey there!

I'm new to docker, and new to alpine in general. I love the work you've done and think it's fantastic for a container-centric future. I'm running into issues using apk update and apk add, in addition to apk-install using the base image provided by gliderlabs/docker-alpine:3.1 (and :3.2, for that matter).

Using a Dockerfile that looks like:

FROM gliderlabs/alpine:3.1
RUN apk --update add mysql-client
ENTRYPOINT ["mysql"]

I get this error:

Step 1 : RUN apk --update add mysql-client
 ---> Running in 9129d237031e
fetch http://dl-4.alpinelinux.org/alpine/v3.1/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-4.alpinelinux.org/alpine/v3.1/main: IO ERROR
WARNING: Ignoring APKINDEX.689bb31a.tar.gz: No such file or directory
ERROR: unsatisfiable constraints:
  mysql-client (missing):
    required by: world[mysql-client]
The command '/bin/sh -c apk --update add mysql-client' returned a non-zero code: 1

After doing some research (which was rather annoying, as the Alpine Linux wiki is down -- yay google cache and archive.org), everything I was attempting to do seemed to be correct.

Logically, I figured it was an issue with the repository sources. No problem, let's open up /etc/apk/repositores.

Whoops! It looks like by default, you only have http://dl-4.alpinelinux.org/alpine/v3.1/main. I ran into #15 and discovered a list of mirrors which have been most helpful. It currently looks like the following sources are currently failing:

http://dl-3.alpinelinux.org/alpine/v3.1/main
http://dl-4.alpinelinux.org/alpine/v3.1/main

1, 2, and 5 are peachy. I propose adding mirrors to the repositories included in your base image. While it's easy enough for people to add the mirrors themselves, it will save time in the long run, especially for newer users.

Edit (next day): 3 and 4 back up. It would seem the logical choice to add all five mirrors by default.

Alpine libs not compatible with Java 8

Trying to install oracle JDK 8 and I get this error when run:

. /opt/jdk/bin/java -version
/bin/ash: /opt/jdk/bin/java: : not found
/bin/ash: /opt/jdk/bin/java: : not found
@@@@@@@?@@@@ |?@@ddp?td??@?@1q?t/lib64/ld-linux-x86-64.so.2GNU GNU?t?)N?ݓ??;r?Z???h nonexistent directory
/bin/ash: /opt/jdk/bin/java: line 1: ELF: not found
/bin/ash: /opt/jdk/bin/java: ?: not found
/bin/ash: /opt/jdk/bin/java: line 3: ?: not found
/bin/ash: /opt/jdk/bin/java: syntax error: unexpected end of file (expecting ")")

The ldd command give the result:

ldd /opt/jdk/bin/java
    /lib64/ld-linux-x86-64.so.2 (0x7f8da09f8000)
    libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f8da09f8000)
    libjli.so => /opt/jdk/bin/../lib/amd64/jli/libjli.so (0x7f8da07e0000)
    libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f8da09f8000)
    libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f8da09f8000)
Error relocating /opt/jdk/bin/../lib/amd64/jli/libjli.so: __rawmemchr: symbol not found

What could be done?

netstate on non-ipv6 hosts produces warnings

for some reason, only alpine complains about it, see the example: (they ran on a non-ipv6 host)

[root@xxx etc]# docker run -ti --rm alpine  netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       
netstat: /proc/net/tcp6: No such file or directory
netstat: /proc/net/udp6: No such file or directory
netstat: /proc/net/raw6: No such file or directory
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags       Type       State         I-Node Path

ubuntu is fine

[root@xxx etc]# docker run -ti --rm ubuntu  netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags       Type       State         I-Node   Path

Impossible to add new CA file

Hi all,
with the last version of docker image, it's impossible to add a new CA file.

apk update && apk install curl ca-certificates \
&& curl https://www.gandi.net/static/CAs/GandiStandardSSLCA2.pem -o /usr/local/share/ca-certificates/GandiStandardSSLCA2.crt \
&& update-ca-certificates
/#  WARNING: ca-cert-GandiStandardSSLCA2.pem does not contain exactly one certificate or CRL: skipping

Have fun,
Thanks.

PS: Related to closed issue : #30

/bin/sh Permission denied

After I install executable binary files (racket for example) I can't launch it and shell says: Permission denied.
I have no idea why it happens. With other images is all ok.
What should I do?

[Node]-Oracle Instant Client

I am just curious if anyone has this working with oracle instant client, I would love to use this for our node deployments but we need to connect to oracle which means that we need the instant client along with the oracle npm.

failing to start executable

I didn't catch anyone on IRC so...

On one machine (different distro) I am building an executable:

root@0693f9aa601d:/go# ldd bin/server 
    linux-vdso.so.1 (0x00007fffa7355000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff1480c5000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff147ea8000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff147afe000)
    /lib64/ld-linux-x86-64.so.2 (0x00007ff1482cf000)

Now in a docker-alphine based container I trying to run it:

/app # ls -la
total 9880
drwxr-xr-x    2 root     root          4096 Feb 28 14:31 .
drwxr-xr-x   28 root     root          4096 Feb 28 14:47 ..
-rwxr-xr-x    1 root     root      10105256 Feb 28 14:27 server
/app # ldd server 
    /lib64/ld-linux-x86-64.so.2 (0x7f3638d64000)
    libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f3638d64000)
    libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f3638d64000)
    libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f3638d64000)
/app # ./server
sh: ./server: not found

Yet it just gives not found. WHAT?

Any idea what's going on?

not demonise nginx image

my Dockerfile

FROM gliderlabs/alpine:3.1
RUN apk-install nginx
RUN mkdir -p /tmp/nginx/client-body
EXPOSE 80
CMD ["nginx"]

if start docker container as sudo docker run -i -t test_mainteiner/nginx /bin/sh all good work,
if start as sudo docker run -i -t test_mainteiner/nginx container not started as demon

“date -d” command fails on Alpine Linux Docker container

I built Alpine Linux in a Docker container with the following Dockerfile:

FROM alpine:3.2
RUN apk add --update jq curl && rm -rf /var/cache/apk/*

the build run successfully:

$ docker build -t collector .
Sending build context to Docker daemon 2.048 kB
Sending build context to Docker daemon
Step 0 : FROM alpine:3.2
3.2: Pulling from alpine
8697b6cc1f48: Already exists
alpine:3.2: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:eb84cc74347e4d7c484d566dec8a5eef82bab1b78308b92cda559bcff29c27cc
Status: Downloaded newer image for alpine:3.2
---> 8697b6cc1f48
Step 1 : RUN apk add --update jq curl && rm -rf /var/cache/apk/*
---> Running in 888571296e79
fetch http://dl-4.alpinelinux.org/alpine/v3.2/main/x86_64/APKINDEX.tar.gz
(1/11) Installing run-parts (4.4-r0)
(2/11) Installing openssl (1.0.2a-r1)
(3/11) Installing lua5.2-libs (5.2.4-r0)
(4/11) Installing lua5.2 (5.2.4-r0)
(5/11) Installing ncurses-terminfo-base (5.9-r3)
(6/11) Installing ncurses-widec-libs (5.9-r3)
(7/11) Installing lua5.2-posix (33.3.1-r2)
(8/11) Installing ca-certificates (20141019-r2)
(9/11) Installing libssh2 (1.5.0-r0)
(10/11) Installing curl (7.42.1-r0)
(11/11) Installing jq (1.4-r0)
Executing busybox-1.23.2-r0.trigger
Executing ca-certificates-20141019-r2.trigger
OK: 9 MiB in 26 packages
---> 7625779b773d
Removing intermediate container 888571296e79
Successfully built 7625779b773d

anyway when I run date -d it fails:

$ docker run -i -t collector sh
/ # date -d yesterday
date: invalid date 'yesterday'
/ # date -d now
date: invalid date 'now'
/ # date -d next-month
date: invalid date 'next-month'

while the rest of the options seem running ok:

/ # date
Sat May 30 18:57:24 UTC 2015
/ # date +"%A"
Saturday
/ # date +"%Y-%m-%dT%H:%M:%SZ"
2015-05-30T19:00:38Z

downloaded Nodejs will not run

I have this dockerfile https://registry.hub.docker.com/u/zinvoice/kibana/dockerfile/ that installs kibana4
now I have the problem that I can not run node.

/ # ls -la /opt/kibana-4.0.0-linux-x64/node/bin/
total 10920
drwxr-xr-x    2 root     dialout       4096 Feb 20 15:26 .
drwxr-xr-x    6 root     dialout       4096 Feb 20 15:17 ..
-rwxrwxrwx    1 root     dialout   11167042 Feb 19 16:10 node
-rwxrwxrwx    1 root     dialout       2290 Feb 19 16:10 npm
/ # /opt/kibana-4.0.0-linux-x64/node/bin/node 
sh: /opt/kibana-4.0.0-linux-x64/node/bin/node: not found

You can reproduce

mkdir /opt
wget -qcO - http://download.elasticsearch.org/kibana/kibana/kibana-4.0.0-linux-x64.tar.gz | gunzip -c | tar -xf - -C /opt
/opt/kibana-4.0.0-linux-x64/node/bin/node

I tried to chown/chmod and downloaded the need linux dependencies but I still can not run nodejs

also tried to run http://nodejs.org/dist/v0.12.0/node-v0.12.0-linux-x64.tar.gz with the same result.

List of possible tests to add

Some tests that I have been thinking of or have bitten me while messing with the build script:

  • Proper timezone.
  • Existence (or absence) of apk-install script.
  • Cleanup of APKINDEX.
  • Correct version.
  • A package installs cleanly.
  • Mirror is set correctly.

`RUN apk ...` in a Dockerfile can succeed while failing to install packages

If I put the Dockerfile example from http://gliderlabs.viewdocs.io/docker-alpine/usage in a file and do Docker build ., it will often fail to install packages, but not fail (that step of) the build.

Here's a transcript of this happening:

$ cat Dockerfile 
FROM gliderlabs/alpine:3.1
RUN apk add --update \
    python \
    python-dev \
    py-pip \
    build-base \
  && pip install virtualenv \
  && rm -rf /var/cache/apk/*
$ docker build .
Sending build context to Docker daemon 2.048 kB
Sending build context to Docker daemon 
Step 0 : FROM gliderlabs/alpine:3.1
 ---> c9fa955c112e
Step 1 : RUN apk add --update     python     python-dev     py-pip     build-base   && pip install virtualenv   && rm -rf /var/cache/apk/*
 ---> Running in 8b06601a9ccd
fetch http://dl-4.alpinelinux.org/alpine/v3.1/main/x86_64/APKINDEX.tar.gz
(1/34) Installing libbz2 (1.0.6-r3)
(2/34) Installing expat (2.1.0-r1)
(3/34) Installing libffi (3.0.13-r0)
(4/34) Installing gdbm (1.11-r0)
(5/34) Installing ncurses-terminfo-base (5.9-r3)
(6/34) Installing ncurses-libs (5.9-r3)
(7/34) Installing readline (6.3-r3)
(8/34) Installing sqlite-libs (3.8.7.4-r0)
(9/34) Installing python (2.7.9-r0)
ERROR: python-2.7.9-r0: Resource temporarily unavailable
(10/34) Installing python-doc (2.7.9-r0)
(11/34) Installing python-tests (2.7.9-r0)
ERROR: python-tests-2.7.9-r0: Resource temporarily unavailable
(12/34) Installing py-gdbm (2.7.9-r0)
(13/34) Installing pkgconf (0.9.7-r0)
(14/34) Installing pkgconfig (0.25-r1)
(15/34) Installing python-dev (2.7.9-r0)
(16/34) Installing py-setuptools (1.1.7-r0)
(17/34) Installing py-pip (1.5.6-r2)
ERROR: py-pip-1.5.6-r2: Resource temporarily unavailable
(18/34) Installing binutils-libs (2.24-r3)
(19/34) Installing binutils (2.24-r3)
(20/34) Installing libgomp (4.8.3-r0)
(21/34) Installing gmp5 (5.1.3-r0)
ERROR: gmp5-5.1.3-r0: Resource temporarily unavailable
(22/34) Installing mpfr3 (3.1.2-r0)
(23/34) Installing mpc1 (1.0.1-r0)
ERROR: mpc1-1.0.1-r0: Resource temporarily unavailable
(24/34) Installing gcc (4.8.3-r0)
ERROR: gcc-4.8.3-r0: Resource temporarily unavailable
(25/34) Installing make (4.1-r0)
(26/34) Installing patch (2.7.1-r1)
(27/34) Installing musl-dbg (1.1.5-r2)
(28/34) Installing musl-dev (1.1.5-r2)
(29/34) Installing linux-headers (3.12.6-r1)
(30/34) Installing libc-dev (0.6-r0)
(31/34) Installing libgcc (4.8.3-r0)
ERROR: libgcc-4.8.3-r0: Resource temporarily unavailable
(32/34) Installing libstdc++ (4.8.3-r0)
ERROR: libstdc++-4.8.3-r0: Resource temporarily unavailable
(33/34) Installing g++ (4.8.3-r0)
(34/34) Installing build-base (0.3-r0)
Executing busybox-1.22.1-r14.trigger
8 errors; 87 MiB in 41 packages
/bin/sh: pip: not found

Edit: I'm running docker 1.5 in a VirtualBox VM with Ubuntu 14.04.

npm install node-expat

Even after

apk-install nodejs python gcc make

npm install node-expat

==> not a success

Problem using PyInstaller on Alpine (musl)

On project calico, we currently use a ubuntu base image but I'd love to swithc to alpine. The current stumbling block is with PyInstaller which doesn't seem to be compatible with libc.musl

The output I'm seeing from PyInstaller is below, and can also be seen at https://semaphoreci.com/calico/calico-docker--5/branches/alpine-build/builds/1

5 INFO: wrote /code/calicoctl.spec
18 INFO: UPX is not available.
30 INFO: Processing hook hook-os
97 INFO: Processing hook hook-time
98 INFO: Processing hook hook-cPickle
155 INFO: Processing hook hook-_sre
246 INFO: Processing hook hook-cStringIO
304 INFO: Processing hook hook-encodings
328 INFO: Processing hook hook-codecs
580 INFO: Extending PYTHONPATH with /code
581 INFO: checking Analysis
581 INFO: building Analysis because out00-Analysis.toc non existent
581 INFO: running Analysis out00-Analysis.toc
585 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/libpython2.7.so.1.0)
619 INFO: Analyzing /usr/lib/python2.7/site-packages/PyInstaller/loader/_pyi_bootstrap.py
627 INFO: Processing hook hook-os
636 INFO: Processing hook hook-site
645 INFO: Processing hook hook-encodings
704 INFO: Processing hook hook-time
706 INFO: Processing hook hook-cPickle
770 INFO: Processing hook hook-_sre
857 INFO: Processing hook hook-cStringIO
965 INFO: Processing hook hook-codecs
1323 INFO: Processing hook hook-pydoc
1419 INFO: Processing hook hook-email
1467 INFO: Processing hook hook-httplib
1489 INFO: Processing hook hook-email.message
1526 INFO: Analyzing /usr/lib/python2.7/site-packages/PyInstaller/loader/pyi_importers.py
1578 INFO: Analyzing /usr/lib/python2.7/site-packages/PyInstaller/loader/pyi_archive.py
1604 INFO: Analyzing /usr/lib/python2.7/site-packages/PyInstaller/loader/pyi_carchive.py
1630 INFO: Analyzing /usr/lib/python2.7/site-packages/PyInstaller/loader/pyi_os_path.py
1633 INFO: Analyzing calico_containers/calicoctl.py
1907 INFO: Processing hook hook-xml
1936 INFO: Processing hook hook-xml.sax
1991 INFO: Processing hook hook-pyexpat
2444 INFO: Processing hook hook-distutils
2671 INFO: Looking for run-time hooks
2676 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/datetime.so)
2678 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/site-packages/greenlet.so)
2681 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/site-packages/gevent/ares.so)
2683 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/site-packages/gevent/_util.so)
2686 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_codecs_tw.so)
2689 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/select.so)
2692 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_heapq.so)
2694 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/binascii.so)
2697 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/cPickle.so)
2701 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/unicodedata.so)
2710 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_bisect.so)
2712 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/strop.so)
2714 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_codecs_iso2022.so)
2717 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/site-packages/gevent/_semaphore.so)
2720 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/cStringIO.so)
2722 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/math.so)
2725 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_locale.so)
2728 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_collections.so)
2730 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/array.so)
2734 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_csv.so)
2737 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_codecs_hk.so)
2741 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_hashlib.so)
2744 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/bz2.so)
2747 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_ssl.so)
2752 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_io.so)
2754 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_json.so)
2757 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/resource.so)
2760 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/fcntl.so)
2764 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_ctypes.so)
2767 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/itertools.so)
2771 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/termios.so)
2774 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_codecs_kr.so)
2777 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/zlib.so)
2780 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/pyexpat.so)
2782 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/audioop.so)
2785 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/site-packages/gevent/core.so)
2787 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_functools.so)
2791 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_multibytecodec.so)
2794 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/operator.so)
2798 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_codecs_jp.so)
2801 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_socket.so)
2804 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_codecs_cn.so)
2808 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_struct.so)
2811 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/_random.so)
2814 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/grp.so)
2817 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/readline.so)
2819 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/python2.7/lib-dynload/time.so)
2821 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /lib/libz.so.1)
2833 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /lib/libcrypto.so.1.0.0)
2835 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/libbz2.so.1)
2838 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /lib/libssl.so.1.0.0)
2842 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/libffi.so.6)
2844 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/libexpat.so.1)
2847 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/libreadline.so.6)
2849 ERROR: Can not find libc.musl-x86_64.so.1 in path ldd (needed by /usr/lib/libncurses.so.5)
2851 INFO: Using Python library /usr/lib/libpython2.7.so.1.0
2875 INFO: Warnings written to /code/build/calicoctl/warncalicoctl.txt
2884 INFO: checking PYZ
2884 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing
2884 INFO: building PYZ (ZlibArchive) out00-PYZ.toc
6214 INFO: checking PKG
6214 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing
6214 INFO: building PKG (CArchive) out00-PKG.pkg
9318 INFO: checking EXE
9318 INFO: building because out00-EXE.toc missing or bad
9318 INFO: building EXE from out00-EXE.toc
9319 INFO: Appending archive to EXE /code/dist/calicoctl

You can repro by cloning calico-docker, checking out the alpine-build branch and typing make binary

npm install sqlite3 --build-from-source (fails)

I've had heaps of problems with sqlite3 earlier, but mostly managed to figure it out by reading the errors carefully. This time however I'm quite stuck. Any ideas?

FROM alpine:edge

RUN echo "http://nl.alpinelinux.org/alpine/edge/main" > /etc/apk/repositories && \
    echo "http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
    apk add -U iojs wget ca-certificates python make gcc libc-dev g++ && \
    apk upgrade && \
    npm install sqlite3 --build-from-source

this will give error

...
../src/statement.cc: In static member function 'static void node_sqlite3::Statement::Work_BeginReset(node_sqlite3::Statement::Baton*)':
../src/macros.h:122:9: warning: unused variable 'status' [-Wunused-variable]
     int status = uv_queue_work(uv_default_loop(),                              \
         ^
../src/statement.cc:725:5: note: in expansion of macro 'STATEMENT_BEGIN'
     STATEMENT_BEGIN(Reset);
     ^
  SOLINK_MODULE(target) Release/obj.target/node_sqlite3.node
/usr/lib/gcc/x86_64-alpine-linux-musl/5.1.0/../../../../x86_64-alpine-linux-musl/bin/ld: Release/obj.target/node_sqlite3.node: No symbol version section for versioned symbol `memcpy@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-alpine-linux-musl/5.1.0/../../../../x86_64-alpine-linux-musl/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
node_sqlite3.target.mk:130: recipe for target 'Release/obj.target/node_sqlite3.node' failed
make: *** [Release/obj.target/node_sqlite3.node] Error 1
make: Leaving directory '/node_modules/sqlite3/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:199:12)
gyp ERR! System Linux 3.13.0-43-generic
gyp ERR! command "/usr/bin/iojs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/node_modules/sqlite3/lib/binding/node-v44-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/node_modules/sqlite3/lib/binding/node-v44-linux-x64"
gyp ERR! cwd /node_modules/sqlite3
gyp ERR! node -v v2.2.1
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
...

I suspect it has to do with memcpy@GLIBC_2.2.5, but really I couldn't find out what.

For all I know this might be a io.js issue, but I seem to recall this worked in ubuntu base image

Full log (commands and all errors)
http://pastebin.com/YZShJzY2

Thanks for any input

Code license

Hello.

Thank you for releasing this to the world and making it available for everybody to benefit!

I was peeking around some of the scripts and considering it's usage for mini-containers/base, but before I do that, we need to know the licensing terms the code is made available.

Having a clear mention of the licensing on both README.md and the presence of a LICENSE file will be very helpful.

Once again, thank you for releasing this! ❤️ ❤️ ❤️

Can't clone private git repo

Is there a preferred way to clone a private git repo? All my attempts to get this to work so far are failing.

I am copying a private key in to my container and attempting to use it to clone a private repo. I can clone the repo manually if I log in to the container and accept the RSA fingerprint.

This is always failing when I attempt to automate the pulling of the private repo, I have tried tried adding to disable strict host key checking by adding a config in /root/.ssh/config. I have tried other various configs in the ssh_config but haven't had any luck.

Here is the message I am seeing.

Step 7 : RUN git clone [email protected]:mycoolrepo.git /opt/repo
 ---> Running in de83ebb98ee9
Cloning into '/opt/repo'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The line in the Dockerfile looks like this:

COPY id_rsa /root/.ssh/id_rsa
RUN chmod 600 /root/.ssh/id_rsa && echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config

This method is working for other distros. How can I get the key to automatically get accepted?

As a note, I am able to copy an existing known_hosts file in to the image and it works.

Unable to install ruby gem 'nokogiri'

Hi, I am using base image of gliderlabs/alpine:3.1, and found that not able to instal ruby gems nokogiri.

My Dockerfile

RUN apk add --update \
  bash \
  ca-certificates \
  libxml2 \
  libxslt \
  gcc \
  ruby \
  ruby-bundler \
  ruby-dev \
  nodejs \
  mysql-client \
  imagemagick \
  nginx \
  && rm -rf /var/cache/apk/* \
  && adduser -D app \
  && gem install bundler --no-document \
  && gem install rails nokogiri \
  && npm install -g react-tools babel

As I want to install nokogiri, following error shows:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.>

    /usr/bin/ruby extconf.rb
 Building nokogiri using packaged libraries.
 -----
 libiconv is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
 -----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby
    --help
    --clean
    --use-system-libraries
    --enable-static
    --disable-static
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --enable-cross-build
    --disable-cross-build

 extconf failed, exit code 1

Gem files will remain installed in /home/app/webapp/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1 for inspection.
Results logged to /home/app/webapp/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.6.3.1/gem_make.out
An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot
continue.

Is there any way to avoid this?

Unable to bring down container size after deleting a package

I have the below Dockerfile and it creates an image of size 165 MB. When I install the haproxy instead of compiling with "apk add haproxy" the size of the container is 7MB. The size increase mostly corresponds to build-base package. Is there any way that I could bring down the size to the actual root filesystem size itself. The "du -h" command at the / gives 28MB.

FROM gliderlabs/alpine-base:3.2

RUN apk add --update git build-base linux-headers pcre-dev openssl-dev

RUN git clone https://github.com/haproxy/haproxy.git && cd haproxy &&
git checkout v1.5.0 &&
make TARGET=linux2628 CPU=native USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 &&
cp haproxy /usr/local/bin/ && cd .. && rm -rf haproxy
RUN apk del build-base linux-headers pcre-dev openssl-dev
RUN rm -rf /var/cache/apk/*

CMD "/bin/bash"

curl is dependent on lua??

Why do curl need lua?

(not needed in opkg)

/ # apk-install curl
fetch http://dl-4.alpinelinux.org/alpine/v3.1/main/x86_64/APKINDEX.tar.gz
(1/8) Installing run-parts (4.4-r0)
(2/8) Installing openssl (1.0.1k-r0)
(3/8) Installing lua5.2-libs (5.2.3-r0)
(4/8) Installing lua5.2 (5.2.3-r0)
(5/8) Installing lua5.2-posix (32-r1)
(6/8) Installing ca-certificates (20141019-r0)
(7/8) Installing libssh2 (1.4.3-r0)
(8/8) Installing curl (7.39.0-r0)
Executing busybox-1.22.1-r14.trigger
Executing ca-certificates-20141019-r0.trigger
OK: 8 MiB in 23 packages

Container size

My Dockerfile

FROM gliderlabs/alpine
RUN apk-install alpine-sdk
RUN apk del alpine-sdk

After build container is 139.6Mb in size. Tried using with different packages, result is same. Tried using --virtual pak option. Tried to build on my machine and on docker hub. Any advice? My goal is to install build dependecies and remove then after building packages from sources.

official image lacks apk-install

is this by accident or on purpose?

if accident, then a big 👍 for #14

user@wormhole:~$ docker pull alpine:latest
511136ea3c5a: Already exists 
b0b08730b93c: Already exists 
alpine:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Status: Image is up to date for alpine:latest
user@wormhole:~$ docker run --rm -t alpine:latest find / -name apk-install
user@wormhole:~$ 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.